Hi,
What would be the best way to implement a timed trap? For instance a jet of flame or perhaps spikes protrude from the ground every few seconds before retracting - but you are only harmed in the time that they are visible. I have tried setting one or two frames of an animation sequence as harm tiles but it didn't seem to work. You would also have to take damage if you were standing still on the tile at the wrong time, so I don't think step on NPCs would work.
On tick script checking hero's position + a tag or variable that is turned off and on at regular intervals?
Regards.
Timed harm tile/traps
Moderators: marionline, SDHawk
Timed harm tile/traps
vvight.wordpress.com
You could use a timer, have it start on the autorun, and then cause an animation every so many ticks. I think zones might actually be easier to use here, so you don't have to disable the harm tiles. You could have the timer run a script that checks whether the player is on the specified zone, run the animation, deal damage to the hero (or not), then set the timer again.
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife
Instead of having the script perform the tile animation, you can use a normal tile animation and the "current display tile" or "get tile animation offset" commands to figure out whether the tile should be currently harmful. Otherwise, what kylekrack wrote is easiest.
Last edited by TMC on Wed Sep 14, 2016 4:19 am, edited 1 time in total.