Spike Trap

Started by CrimsonWolf, September 11, 2008, 10:43:33 pm

Previous topic - Next topic

CrimsonWolf

Wasn't sure if this was more of a general question or an event system question, so sorry if i'm in the wrong spot. Anyway, I'm trying to make a spike trap that automatically goes up and down and the player needs to time their movement to get over it correctly without being spiked.

So it's working well so far, except for one problem: If the player is standing on the spikes when they come up, then nothing happens. Here's my current event coding:

Note: The graphics aren't actually called "Spikes emerging", "spikes half-up" etc. I just thought that made more sense than typing "180-Switch03" or whatever.

Event Name: SpikeTrap

-=-=-=-
Page 1
-=-=-=-
-- Conditions --
Switch: None.
Variable None.
Self Switch: None.

-- Graphic --
Spike Holes (not the actually spike).

-- Autonomous Movement --
Move Route: Custom
Wait: 35 Frames
Switch ON: 006 (SpikeTrapSwitch)

Repeat Action [x]

-- Options --
Through [x]

-- Trigger --
Action Button [x]

-- List of Event Commands --
None.

-=-=-=-
Page 2
-=-=-=-
-- Conditions --
Switch: 006 (SpikeTrapSwitch)
Variable None.
Self Switch: None.

-- Graphic --
Spike Holes (not the actually spike).

-- Autonomous Movement --
Move Route: Custom
Change Graphic: Spikes emerging
Wait: 1 Frame
Change Graphic: Spikes half-up
Wait: 1 Frame
Change Graphic: Spikes up
Wait: 1 Frame
Change Graphic: Spikes half-up
Wait: 1 Frame
Change Graphic: Spikes emerging
Wait: 1 Frame
Switch OFF: 006 (Spike Trap Switch)

Repeat Action [x]

-- Options --
None.

-- Trigger --
Event Touch [x]

-- List of Event Commands --
Play SE: Skill 01
Transfer Player: To the start of the room.
Change HP: Entire Party, -50


So if the player touches the spikes when they're up, that works no problem. It's just if the player is already on the tile when the spikes DO come up that nothing happens. Any suggestions?

Aqua

Okay I have 2 solutions in mind but... answer this question first:

Are you gonna have more than one spike trap in the map?

CrimsonWolf

Yes, I will. Some will have quite a number.

Aqua

Okay.

Give the tiles that the spike trap are on a terrain tag of 1. (Go to Tileset > Terrain Tag > Change a new blank tile to 1 and place them where all the spikes should be.)

Have the second page's event commands be blank.

Then on a new parallel process event:

Control Variables = Player's Terrain ID
Conditional if Terrain ID == 1
Play SE: Skill 01
Transfer Player: To the start of the room.
Change HP: Entire Party, -50
end


CrimsonWolf

That sounds like it should work, but now even if my hero touches the tile when the spikes are down, he gets hurt and moves to the start of the room. I'm assuming that's because the spikes now have a terrain tag of 1, but even when the spikes are down they still have this tag. Anyway to fix it?

Aqua

Oops
Have a condition before the Terrain Tag condition that checks if SpikeTrapSwitch is on.

CrimsonWolf

September 11, 2008, 11:36:20 pm #6 Last Edit: September 11, 2008, 11:46:17 pm by CrimsonWolf
Heh, probably should have noticed that myself. But it all works now! Thanks so much Aqua! PowerUp!

Edit: Hmm, there is still one more issue actually. When the event deducts 50 health, it's actually deducting about 300 every time rather than 50. I made sure to put it after the transfer event so the player couldn't be hit twice, but it's still deducting 300. Any ideas?