In the end I figured out a way to get what I was looking for which is a simple pressure plate puzzle where you have to walk a set path to open the door. Stray from the path puzzle resets.
You will need to have the connector target the script and run the checkStep function.
Code:
Code: Select all
i= 1
path = {"p2","p7","p8","p9","p4","p5","p10","p15","p20","p19","p14","p13","p18"} -- This is the list of IDs in the order you wish to trigger them. Though this could also work for buttons , levers, and such
function checkStep(sender)
if path[i] == sender.id then -- If the object calling this function (the sender) has An id = to the current array item then check to see if it is the end or move to next item in array
checkOpen()
spawn("fx", party.level, party.x, party.y, 0):setParticleSystem("teleporter") -- you can toss any effects or other things you would want here as well
i = i + 1
else
resetPuzzle() -- umm reset the puzzle Jim you done got it wrong.
end
end
function resetPuzzle()
spawn("fx", party.level, party.x, party.y, 0):setParticleSystem("fireball_hit")
i = 1 -- this will do a full reset though you could add a check to reset the puzzle to any point on the path.
end
function checkOpen()
if i == table.getn(path) then -- Checks to see if we have stepped through the whole array.
dungeon_secret_door_4:open() -- do your thing here. In this case open the secret door.
i = 14
end
endHopefully this helps someone else