How to build a spike trap that deals damage !

There is a tutorial and demos for the VX maker but none for Maker MV. 


My guess is , it would probably be simpler with MV? How do you go about having spike traps, go up and down at intervals of say a random variable like 5 seconds, and if the player happens to walk over the spike trap when the animation is completely UP, your whole crew takes damage, the screen flashes and you bump a few steps back. 


Now the easy part is the last bits : damage, flash and bump back. The thing I would love to know how to is to be able to just copy paste one Event and let that event applies wherever I place the spike traps. I understand the event has to calculate where I stand ..so I want each event to know where I am without the need to create individual switches for each of them. 
It should honestly work the exact same way as it did in ACE, unless it uses a script call, as the event calls are unchanged. Have you tried implementing the ACE version into MV and seeing what happens?
I have, I got an error : Unexpected token ILLEGAL. 


I have no idea where it points to , even after digging some answers in Google


Edit : Sorry, yea well I got this error from using a script call..so my bad
What you may want to do is post the script call that gave the error. That way someone who knows JavaScript can help you figure out how to fix it? Though I'm not sure if you post it here or in the JavaScript boards, though I lean to the JavaScript boards myself.
I found this on the web somewhere I forgets, forgive me..
I did change it a bit to work from parallel event.
I created two common events
Common Event 1) Name: Trap Control  > Trigger: Parallel  > Switch: Traps On
Wait: 25 frames
Control Variables: 00xx Trap Brain +=1

Common Event 2) Name: Trap Reset > Trigger: Parallel > Switch: Traps On
If Trap Brain >= 3
wait 120 frames
Control Variables: 00xx Trap Brain = 0

In the trap event itself, you would set up 3 pages
first page the image lowest point of spike > set condition variable Trap Brain >= 1 (this effects which image is shown on map), priority below character (so player can walk over)
second page the image mid range spikes > set condition variable Trap Brain >= 2 (this effects which image is shown on map), priority below character (so player can walk over)


third page the image of highest point of spikes > set condition variable Trap Brain >= 3 (this effects which image is shown on map), priority below character (so player can walk over) at this point in the event you would set all your effects, and damage.

Hope it was helpful somewhat...
I found this on the web somewhere I forgets, forgive me..
I did change it a bit to work from parallel event.
I created two common events
Common Event 1) Name: Trap Control  > Trigger: Parallel  > Switch: Traps On
Wait: 25 frames
Control Variables: 00xx Trap Brain +=1

Common Event 2) Name: Trap Reset > Trigger: Parallel > Switch: Traps On
If Trap Brain >= 3
wait 120 frames
Control Variables: 00xx Trap Brain = 0

In the trap event itself, you would set up 3 pages
first page the image lowest point of spike > set condition variable Trap Brain >= 1 (this effects which image is shown on map), priority below character (so player can walk over)
second page the image mid range spikes > set condition variable Trap Brain >= 2 (this effects which image is shown on map), priority below character (so player can walk over)


third page the image of highest point of spikes > set condition variable Trap Brain >= 3 (this effects which image is shown on map), priority below character (so player can walk over) at this point in the event you would set all your effects, and damage.

Hope it was helpful somewhat...



This was very helpful in setting one up, but one issue I found is that after following this, there is a frame where the trap shows nothing on the ground? Any way to fix that?
Nevermind All i had to do is change that 0 to a 1 instead. works great thanks
Nevermind All i had to do is change that 0 to a 1 instead. works great thanks

Ah yeah, I believe in my game the 0 started on a blank page to auto run a random placement script for the traps.
I found this on the web somewhere I forgets, forgive me..
I did change it a bit to work from parallel event.
I created two common events
Common Event 1) Name: Trap Control > Trigger: Parallel > Switch: Traps On
Wait: 25 frames
Control Variables: 00xx Trap Brain +=1

Common Event 2) Name: Trap Reset > Trigger: Parallel > Switch: Traps On
If Trap Brain >= 3
wait 120 frames
Control Variables: 00xx Trap Brain = 0

In the trap event itself, you would set up 3 pages
first page the image lowest point of spike > set condition variable Trap Brain >= 1 (this effects which image is shown on map), priority below character (so player can walk over)
second page the image mid range spikes > set condition variable Trap Brain >= 2 (this effects which image is shown on map), priority below character (so player can walk over)


third page the image of highest point of spikes > set condition variable Trap Brain >= 3 (this effects which image is shown on map), priority below character (so player can walk over) at this point in the event you would set all your effects, and damage.

Hope it was helpful somewhat...

This works great. I do notice one problem is that if you're standing on the lowered spikes and wait for them to come up, they won't damage you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-build-a-spike-trap-that-deals-damage.61824/