Laser Maze

Status
Not open for further replies.

Aquin25

Villager
Member
Joined
Aug 9, 2014
Messages
27
Reaction score
6
First Language
English
Primarily Uses
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?
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
455
Reaction score
432
First Language
german
Primarily Uses
RMMZ
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".
 

Aquin25

Villager
Member
Joined
Aug 9, 2014
Messages
27
Reaction score
6
First Language
English
Primarily Uses
Tried it... laser never goes away.
 
Last edited:

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
455
Reaction score
432
First Language
german
Primarily Uses
RMMZ
Can you provide screenshots of all your events so we can look into your eventing?
 

Mhin Ra

Veteran
Veteran
Joined
Aug 17, 2015
Messages
66
Reaction score
19
First Language
English
Primarily Uses
RMVXA
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.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,740
Reaction score
14,002
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Profile Posts

A part of me wants to return back to the beginning and first two chapters and remake them with parallax map. But I have decided not to. Every chapter is just another step in the journey. No need to walk back unless I have to revise dialouge.
Hey guys! Good news!
I just released the Games from Brazil - Part 2 on my Youtube Channel! I am really happy that part 1 had 100 views and I hope more people will be interested to see the potencial of Brazilian Game Devs!
Effervesce Fallacy™ - Attract Mode (proto)

Forum statistics

Threads
107,573
Messages
1,030,654
Members
139,671
Latest member
WDRS
Top