Laser Maze

Trying to create a segment of my game where the player has to move through a laser maze to escape a facility. The lasers turn on and off, allowing the player to move through with good timing, but die when the lasers are off.

I tried using multiple event pages with a self switch seperator... no dice.

Tried using a loop with a self switch separating things by different paths. The timer froze the player when they made contact with the area.

Any suggestions on how to pull this idea off?
You can make an event with parallel process that does this:

Code:
turn Switch "Lasers" ON
wait 60 frames
turn Switch "Lasers" OFF
wait 60 frames

Each laser event has two pages, one for "Laser ON" and one for "Laser OFF".
Tried it... laser never goes away.
Can you provide screenshots of all your events so we can look into your eventing?
Event pages for a single event do not execute in parallel, even if one of them is tagged as parallel. What I usually do for stuff like this is to make one 'controller' event that's tagged as parallel. That controller runs a fixed script which sets switches on the 'actors' (in this case, the things that fire lasers) to make them turn on and off. With two events, the 'actors' can switch their pages even while the 'controller' stays on it's same page executing your script the whole time. Usually, I have that controller control all the actors on the entire map, rather than 1 controller per actor, for efficiency reasons (lots of parallel events are slow).

If you do what I suggested above, this won't matter as much, but so you know:

Event pages don't stop executing in the middle, even if you set a switch which should trigger another page on that event. So, in your second line, you set Laser ON to true. That will not cause this event to swap to your second page. Instead, the interpreter will continue to run the whole contents of this page. Only when it gets to the end of the page and stops will it evaluate whether it should run a different page or start the same page over again.

But, there's one other gotcha: because you have your event page in a loop that never has a Break Loop in it, I believe page 1 of your event will never stop executing. It needs to finish that loop so it can get to the last 'instruction' on the event page... but since the loop goes on forever, it never does that. Usually, if I want a parallel loop like that to terminate, I just put a conditional check in it for whatever the 'end' condition is and then Break Loop inside the condition. So in your example, if might be "if LaserGameIsDone == true" or something.
Got it all fixed. Seems to work.
Thanks for your help.
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/laser-maze.130565/