As part of a puzzle I'm working on I have an Altar onto which the player places a spiked_club and the club is teleported away to an inaccessible room and an Ogre is spawned.
This is supposed to give the illusion that the Altar performs some kind of necromatic magic and resurrects the Ogre that the club belonged to.
Code: Select all
function surfaceContains(surface, item)
for v,i in surface:contents() do
if i.go.name == item then return true
end
end
end
function ogreAltar()
if surfaceContains(catacomb_altar_candle_01_1.surface, "spiked_club") then
hudPrint("Club Placed")
teleporter_24.controller:activate()
timer_2.timer:start()
else
hudPrint("That does nothing")
end
end
The first time I place spiked_club it works as expected - but any time after that it doesn't matter what I place on the Altar it always activates. I don't understand why this is, do I need to 'reset' the code or the surface component some how? Or have I just stumbled upon a limitation of LoG2?