How to turn off a switch before map transitions

Tamina

Veteran
Veteran
Joined
Dec 22, 2019
Messages
99
Reaction score
40
First Language
English
Primarily Uses
RMMV
Hello, I am looking for a way to turn off a switch before the player got transferred to another map in an event. Are there any plugin or parallel event that can do this?

I know I can manually add a line to turn off the switch before the transfer player event. But my game has over 150 maps, adding them to ALL the maps and cutscenes takes forever.

Thank you
 
Joined
Jul 12, 2020
Messages
96
Reaction score
18
First Language
English
Primarily Uses
RMMV
Correct me if I'm not mistaken, but couldn't you just make your "switch" a common event? I don't believe there's an auto-matic way to do it. Just set 2 common events to trigger during those moments of transition. 1 for ON and 1 for OFF. That, or you could even make just 1 common event with a conditional branch that controls the switch to turn on/off.

It's up to you really, but as far as I'm aware, I don't believe there's an easier way.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,938
Reaction score
1,044
First Language
Dutch
Primarily Uses
RMMV
There are 3 ways, but it depends if it's a global switch, or different switches.
if it is a different switch to turn off, you need to specify which switch willl be OFF,
and if those go back on or not.

if it is 30 different switches, 1 for specific event or after event, those can be turned
off after a specific event, or if you want it to re-run when a player re-enter the map
for the cutscene, use "erase event" else a plugin has to be made.

But you need to be more specific and detailed on those switch(es).
 

zzmmorgan

I've used punchcards
Veteran
Joined
Jul 10, 2020
Messages
114
Reaction score
181
First Language
English
Primarily Uses
RMMV
Why not have the event that's doing the transferring turn the switch off?

◆Transfer Player:South of Village (62,18) (Fade: None)
◆Control Switches:#0013 Slime Killed = OFF
 

Quexp

Lifelong Learner
Veteran
Joined
Jun 18, 2018
Messages
152
Reaction score
312
First Language
English
Primarily Uses
RMMV
I should have thought to try common events but, in case that doesn't work, here's what I did:

I have a map (not used in game) where I pasted a bunch of events I want to reuse. Then I can just copy/paste and change the transfer points. I mainly did this so I don't have to keep adjusting my SE's and volume on doors and chests but I have a couple that add to a Theft variable too.
 

zzmmorgan

I've used punchcards
Veteran
Joined
Jul 10, 2020
Messages
114
Reaction score
181
First Language
English
Primarily Uses
RMMV
Honestly I've been redoing a lot of events to common events as there is so much opportunity to clean things up that way for reuse and making any future changes far easier. My future projects are going to be making HEAVY use of common events for that reason.......
 

Tamina

Veteran
Veteran
Joined
Dec 22, 2019
Messages
99
Reaction score
40
First Language
English
Primarily Uses
RMMV
There are 3 ways, but it depends if it's a global switch, or different switches.
if it is a different switch to turn off, you need to specify which switch willl be OFF,
and if those go back on or not.

if it is 30 different switches, 1 for specific event or after event, those can be turned
off after a specific event, or if you want it to re-run when a player re-enter the map
for the cutscene, use "erase event" else a plugin has to be made.

But you need to be more specific and detailed on those switch(es).

To be more specific, I have an UI that's controlled by a common event switch. If the switch is on the UI is on and vice versa. I do not want the UI to show when player enters another map, so I'd like the switch to be off whenever player goes to a new map.

Why not have the event that's doing the transferring turn the switch off?

◆Transfer Player:South of Village (62,18) (Fade: None)
◆Control Switches:#0013 Slime Killed = OFF
Because I have hundreds of transfer points in the entire project. It's too much work to do it this way, and for sure I'm going to miss a transfer point somewhere in the project. So I'm looking for faster solutions.

I don't think erase event nor copy and paste from another master event works in my case, because all the transfer points are done in the project and there are hundreds of them.
 
Last edited:

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,938
Reaction score
1,044
First Language
Dutch
Primarily Uses
RMMV
if its 1 switch for UI to turn off, and back on after the transfer, a tiny plugin can do the trick,
but I cant make it while I'm kinda busy, but it is doable.

another way that can work (something that has to be paste in every map) is a parallel event
and a scriptcall, (I cant tell exacly how it goes), but when it should be around those lines
(this doesn't work, but you need some search or someone to correct it for a working one):

if ($gamePlayer. (transfercode here) ) {
$gameSwitches.setValue(x, false)

and

if ($gamePlayer. (transfercode here) ) {
$gameSwitches.setValue(x, true)

the 2nd one if transfer = succeeded, the "transfercode here" is around isTransfered()
or another line, which checks if the player is transfering to a new map, and if the player
is succesfully transfered, the switch goes back on, and when ON transfering, the switch
goes OFF.

but I think it does fade out on transfering already on default, when fade in (black) will
cover the full screen to black (cant tell for certain), Need to test it with my own HUD
and transfer to a map and see if it stays or not.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,994
Messages
1,018,204
Members
137,774
Latest member
Halop
Top