help with scripting needed!

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
velojun
Posts: 19
Joined: Sat Sep 15, 2012 9:02 am

help with scripting needed!

Post by velojun »

I would like to spawn two torches inside empty torch holders when a pressure plate is pressed ,
and another script for checking if those two torches are placed in two other torch holders,

also i'd like to know how to make an altar accept a dagger for triggering an event..........
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: help with scripting needed!

Post by Komag »

TorchHolder:addTorch()
Shortcut for “TorchHolder:addItem(spawn(“torch”))”.
just link the pressure plate to a script with the above code for both torchholders, such as:

Code: Select all

function lightitup()
    torchholder1:addTorch()
    torchholder2:addTorch()
end
You can just connect the other two empty torch holders to a counter (set to 2), and connect the counter to whatever you want to happen. This will only be effective if the player doesn't have access to any other torches

I haven't played with Alters yet, but it sounds pretty straightforward
Finished Dungeons - complete mods to play
velojun
Posts: 19
Joined: Sat Sep 15, 2012 9:02 am

Re: help with scripting needed!

Post by velojun »

That was very helpfull for me!
thanks
velojun
Posts: 19
Joined: Sat Sep 15, 2012 9:02 am

Re: help with scripting needed!

Post by velojun »

spawning torches inside empty torch holders works like you said: “TorchHolder:addItem(spawn(“torch”))”.
now this:

ok i have this in the objects file :
SpoilerShow
cloneObject{
name = "sacrificial_torch_holder",
baseObject = "torch_holder",
}
and this in the items file:
SpoilerShow
cloneObject{
name = "sacrificial_torch",
baseObject = "torch_everburning",
uiName = "sacrificial_torch",
attackPower = 8,
damageType = "fire",
description = "This Torch is rapped in bandages, its fire seems brighter.",
}
now how do i set the torch holder to trigger an event if a sacrificial torch is placed in it?
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: help with scripting needed!

Post by Komag »

I don't know how that would be done, hopefully someone smarter than me can help! It's certainly not currently as easy as dealing with alcoves and altars which are designed to hold a variety of objects.

So this might be a case of asking for a new feature in the editor, to make torchholders more like alcoves, able to detect what item is in them, etc.
Finished Dungeons - complete mods to play
Post Reply