A question about switches...I think.

Status
Not open for further replies.

Umpikuja

Villager
Member
Joined
Sep 15, 2016
Messages
12
Reaction score
1
First Language
English
Primarily Uses
I am a beginner. I apologize if this has been asked before. I have been looking around for an answer before coming here.


I want to create an autorun event that happens every time the player enters the map. I want to enter an elevator, shake the screen and rumble a bit, play a ding, end the event and walk out. I see how to do this much with switches. But I want this to happen every time I enter that elevator.

autoruntest01.png
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,837
Reaction score
12,250
First Language
English
Primarily Uses
RMMV
Good try, but not quite right.


Using switches or self switches to active a new event page is a permanent thing.  It doesn't get reset when you re-enter the map, but only when you deliberately change the switch or self switch again.


To have something run every time you enter a map, you simply use an Erase Event command.  That removes the event for the remainder of the time you're on the map, but when the map is next loaded, that event will be loaded again too.


Also, unless this is something that takes some time to run and you don't want the player to be able to move while it's happening, I suggest you change it to parallel process trigger instead of autorun.  Autoruns remove control from the player, and if you have several, only one of them will run at a time (and I'm not sure if they will queue up, but if they do, you have no control over the order).  Parallel process events will all run at the same time, and will allow the player to keep doing stuff as well.


So to fix your event, remove any references to self switches and remove the second page, and add Erase Event as the last command.
 
Last edited by a moderator:

Dad3353

Veteran
Veteran
Joined
Mar 9, 2016
Messages
421
Reaction score
108
First Language
English
Primarily Uses
Assuming that the Map on which this Event is placed is the inside of this Elevator itself, remove the Self Switch and Page 2, replace the Self Switch with Erase Event. The Event will run, as before, automatically, then erase itself until the next time that the Map is entered.


The Self Switch is inappropriate as, once triggered, it remains triggered. Re-entering the Map does not reset the Self Switch.


Try it..?
 

BehemothRPG

Villager
Member
Joined
Sep 3, 2016
Messages
20
Reaction score
3
First Language
German
Primarily Uses
Well in fact you COULD reset a self switch by calling:


$gameSelfSwitches.setValue([mapId, eventId, 'A'], false);


But in this case it would just be unproper coding ;)
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
12,724
Reaction score
13,134
First Language
English
Primarily Uses
RMVXA
Because they don't need to reset the switch at all. If it is supposed to happen every time, there is no purpose to turning the switch on then back off. What would be better is to either do erase event (so it is there next time), or do what Shaz suggested.
 

Umpikuja

Villager
Member
Joined
Sep 15, 2016
Messages
12
Reaction score
1
First Language
English
Primarily Uses
Thanks everyone! You are awesome, all of you! It works perfectly!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,191
Reaction score
4,302
First Language
Dutch
Primarily Uses
RMXP

Liftyfied, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

I usually don't enjoy survival games, but I absolutely love Conan Exiles.
Basically Everyone: Dont make a long game the first time. Me: I guess i'll make a REALLY long game in that case >:p
I've developed a habit of thanking cleaning ladies for their work.
Sorry Aerith... I will abandon your shoes... :guffaw:
Spent a whole bunch of time today reworking the area in the video because someone said it was too illusory. So I reworked it so it changes less, moved the grass up to the same level as the player.... And found enough extra resources to make the grass moves when the player touches it. Also lots more water, because it looks amazing. I'll probably put up a short updated video later today.

Forum statistics

Threads
95,771
Messages
931,768
Members
126,170
Latest member
2969910490
Top