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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,397
Reaction score
15,211
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
111
First Language
English
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
13,937
Reaction score
14,773
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!
 

Dad3353

Veteran
Veteran
Joined
Mar 9, 2016
Messages
421
Reaction score
111
First Language
English
R91KekF.gif
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,938
Reaction score
5,852
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.

Latest Threads

Latest Posts

Latest Profile Posts

Are ReSTAFFs a thing anymore? Just curious, not sure if this is thread-worthy, so just musing here
Mr_Petue wrote on ATT_Turan's profile.
please explain, why you are voting my commentary negativ.
Mr_Petue wrote on Eliaquim's profile.
please explain, why you are voting my commentary negativ.
Uploaded a new Video today where I play Minecraft "The Bridge" please check it out & let me know what you think of it!
I normally only post these every 24 hours, but same-sex marriage is coming to Rune Factory 5 and I just wanted to share it with the world! https://www.xseedgames.com/2021/09/23/rune-factory-5-localization-blog-2/

Forum statistics

Threads
115,320
Messages
1,088,931
Members
149,972
Latest member
LordRnginu
Top