Page 1 of 1
help with scripting needed!
Posted: Mon Sep 17, 2012 8:18 am
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..........
Re: help with scripting needed!
Posted: Mon Sep 17, 2012 12:29 pm
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
Re: help with scripting needed!
Posted: Mon Sep 17, 2012 2:28 pm
by velojun
That was very helpfull for me!
thanks
Re: help with scripting needed!
Posted: Tue Sep 18, 2012 9:23 am
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 :
cloneObject{
name = "sacrificial_torch_holder",
baseObject = "torch_holder",
}
and this in the items file:
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?
Re: help with scripting needed!
Posted: Tue Sep 18, 2012 12:51 pm
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.