I´m learning new things all the time, but still have no idea how some things work.
in the dungeon i`m currently working on,you will pick up a custom asset item called corpse, and place it to an altar.
then, the code`s supposed to remove the corpse and add a new champion to your party.
I use the Item on a alcove puzzle in modding guides for checking the item, and i know how to add the character, but after that i have no idea
what to do.Here`s what i tried:
Code: Select all
function restoreCorpsel()
-- iterate through all contained items on altar, checking for a matching name
for i in altarOfRestoration:containedItems() do
if i.name == "corpse" then
local champ = party:getChampion(2);
if ( champ:getEnabled() == false ) then
-- here it sets the champion`s stats and such
end
end
break
else
hudPrint("The altar can`t restore that")
end
end
end
1.make this work?
2. set it so that it will remove the corpse from the altar?
To the next question we go!
when you progress a little further, all torches in the room you are in are supposed to be deactivated by a script when the party presses a pressure plate.
in this one, i have no idea on how to do it.
Credit to mahric for making this piece of code below:
Code: Select all
function keepTorch(t)
t:addItem(spawn("torch"))
setMouseItem(nil)
hudPrint("This torch is bolted to the wall and can't be removed")
end Thanks for reading this far, if you can help me, please reply and explain me how should i do it.