Timed Spike Trap Tutorial

So a couple of us (Myself, @Frogboy and @just1witness ) figured this out to fix Frogboy's problem in support and we thought this would be handy for you guys. This is not my work but the work of 3 of us.

Its a tutorial on how to build timed spike traps. (or any kind of traps for that matter) As far as I can tell its the most efficient way to build one especially if you are going to have many on the one map.

It cuts out
  1. the need for plugins,
  2. tracking the location of each trap via variables,
  3. Using a bunch of conditional branches for each trap
  4. and imho is a total time saver.

Here's a video of how easy it is to add a new trap without having to set co-ordinates, new variables etc...


Just a matter of copy and pasting the event and painting a region underneath.

Lets start with the traps themselves. They are a simple event and just require 2 pages (one on, one off).
Page one looks like...
44699-6a44ee90a830b5523e66b27b491e9f9f.jpg

and Page 2 looks like
44700-35c565010903643e7faa4b2507293296.jpg


So as you can see, its a simple event. In page 1, The trap is off waits 90 frames, plays a sound effect and turns on.
Page 2 the trap is on, spikes are up and again it waits 90 frames and than plays SE and turns off.

Now the fun part. Create another Parallell Process Event anywhere on the map.
Set it up as follows, its only one page.
index.php


Here we are creating and event that ONLY runs when the spike trap is on, so it must have a condition switch to match the one you set when turning the trap on in the trap events.
Now we only need 3 variables.
  • "PlayerX"is tracking the players x coordinate on the map.
  • "PlayerY" is tracking the player y coordinate on the map
  • "varRegionIDtrack" is created in the underused Get Location Info section.
Here's how.
  1. Simply add the Get Location Info.
  2. When it opens set the variable to whatever number you made "varRegionIDtrack",
  3. Choose Region ID in the next dropdown menu.
  4. For location choose "Designation with Variables"
  5. Set the x: dropdown to your "PlayerX" tracking variable.
  6. Set the y: dropdown to your "PlayerY" tracking variable.
What this now means is the game is always tracking the current region ID of the co-ordinate the player is standing on and saving it to our variable "varRegionIDtrack".

From here we simply create a simple conditional branch and set it up as follows.
if the players "varRegionIDtrack" = 1, so basically if the player is standing on region 1, (our spike traps.) the event will trigger.
When the event triggers
  1. It will show the animation,
  2. remove the HP, (these are upside down in the SS but it makes no odds.
  3. Wait 20 frames (this gives the event graphic time to appear and not just flash)
  4. Finally it will turn of the switch and play the off SE. (this is hugely important so the event doesn't keep triggering for the entire 90 frames.)
Nicely done!
Very clean and compact. I can't wait to try it out. 😀

Thank you.
@padr81, thank you.
This tutorial works SO WELL I just wanted to add that I was fiddling around with the timers and figured out how to make the spikes rise up and down a bit more naturally.
Screenshot 2019-06-26 21.27.31.png

Screenshot 2019-06-26 21.27.29.png

I didn't change the tracker with the exception of making the Wait 90 frames, removing the animation, and setting a move route to make the player take a step backwards (do NOT check wait for completion)

Either way this tutorial is awesome and it works wonders for my games simple traps.
This tutorial works SO WELL I just wanted to add that I was fiddling around with the timers and figured out how to make the spikes rise up and down a bit more naturally. View attachment 118337
View attachment 118338
I didn't change the tracker with the exception of making the Wait 90 frames, removing the animation, and setting a move route to make the player take a step backwards (do NOT check wait for completion)

Either way this tutorial is awesome and it works wonders for my games simple traps.

Awesome, I should have thought of that but I'm lazy.
I did this, but when I execute, it doesn't seem to work. The animation works fine. But when I touch or anything else during it's up, nothing happens.
@Nigi - Sorry about the delay, can you screen shot your event pages and I'll have a quick look to check.
Mine doesn't work, I did the same thing, but it doesn't show me any damage.
I will share my screenshot.
Screenshot (188).png
Thank you, it works like a charm!

But since I am noob I want to clarify to all beginners like me, that to make this work you have to set the number of the region over the trap tile (the numbers that you see on the "R" tab in the tile editor).
The tutorial is supposing that you are using number 1. If you use others you will have to change the condition in the If statement.

I just wanted to add this, because new users may not be familiar with the R tab and its function (I cannot say I am). Maybe the video was clearer on this, but it is not available anymore and it took me a while to understand.

Original thread: https://forums.rpgmakerweb.com/threads/timed-spike-trap-tutorial.79746/