Spike Trap Hallway

Ive been working on this one section too long, ive watched a dozen tutorials and i understand how to get the spikes to work.
However, im not able to get them to react the way i envision.

All i need to know is how to offset them, as the player dashes down a hall i want each to pop up individually
I can get them to go up ALL at once, but thats it

I have it scripted to follow the player's coordinates but its still not working, any and all help is appreciated!
You could try player touch trigger then put a wait 30 frames, Set self switch A. Then a new event page with the Self Switch A box checked and the spikes up
Okay, i was WAY over-doing this. ive go it behaving the way i want (for the most part), but i created a new problem

the player gets damaged when standing on extruded spikes, but KEEPS taking damage when not, i have variables for the players x and y but im not sure how that even works


Spoiler
1739147394499.png
I thought you wanted
Player goes over withdrawn spike tile>30 frames later the spike goes up

Any page you set to parallel will run that set of commands over and over again.

What is on your first event page?

Actually, you're turning the self switch off at the end, but if the first event page is player touch it will just retrigger the second page again if he's still standing on it when it retracts.
Sorry! I assumed it made sense

Page 1 is just the self switch, nothing else
And the self switch at the end is leftover sorry

Yes, i want the spike to go up after the player crossed, but i ALSO want the player to consistently take damage from the spikes
Do you want the spikes to go back down once they're up? You need to say exactly what you want to happen step by step because that is how the computer will read and execute instructions.
regardless of if the spikes are up or down, the player takes damage when they arent anywhere near the event if its stepped on after triggered

player dash = perfect
player walk = damage for being too slow
player stand = damage for continuing to stand on spike

My 2 problems are that once the event is walked across, stepping on it again causes a constant bleed regardless of where the player goes, and this isnt the desired outcome

The player also only takes damage once, and looping it nearly crashed the game, so im stuck
(i do not know how to code so if theres a script solution im probably gonna need it spelled out sorry😅)
What does your first page look like? What trigger are you using? Could you screencap it?

Are you putting wait 30 frames then self switch A on like I said in my first post?
its literally just the switch
Spoiler
1739157267610.png
The player takes damage even when not on the trap because the only condition for the party damage is that the trap is facing up. You would have to put the damage command under another condition. If: ($gamePlayer.x==this.character(0).x&&$gamePlayer.y==this.character(0).y)
This works, for the most part, however the player is still taking damage off the spikes
I added the script, page 1 is the same still, im not sure why its still happening

(if theres a way to upload clips i could if that would help)


Spoiler
1739162555283.png
1739162480606.png
Why did you put it in a loop? You keep doing things I never told you to do.

I am not even sure why you have the "event is facing up" conditional. What direction is it facing by default? You never set it to up until the very end.
i put it in a loop because it only hurts the player once, i want to hurt the player multiple times

i dont need it set like that i just followed a tutorial im sorry im not trying to be difficult

edit: tutorial guy said its to ensure that thats the frame the player takes damage on
The logical reading of what you have now is:

If the event is facing up and the player and event's position is the same, lock the game into a repeating loop damaging the player until he is dead.
yes, but thats not whats happening! yes the player takes damage on the spikes, but after that they STILL take damage OFF the spikes. i cannot for the life of me understand why
Because you passed the check of the player sharing the same position of the event once, so you told it to infinitely loop the screen flash and health drain until he is dead.
without the loop the player doesnt take damage
Instead of Self-Switches, I suggest using global Switches. A spike should not handle it's on/off state, but deal damage only.

Let's create e.g. 3 Switches for the spikes like "Spike group 1", "Spike group 2", "Spike group 3". Make an invisible event on the map with parallel process and this event should manage when and for how long each Switch is ON or OFF.

Now, you can bind the spike events to these Switches instead of the Self-Switches, and strip their eventing to the damage part only.
im starting to feel bad with all the problems im having😅

the spikes consistently hurt the player! awesome

however, now it doesnt wait the 30 frames, and the animation loops(i can fix that in the movement tab somehow im sure)


Spoiler
1739180384808.png
1739180396419.png
1739180411987.png

Original thread: https://forums.rpgmakerweb.com/threads/spike-trap-hallway.175305/