How to turn off a switch before map transitions

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
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.
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).
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
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.
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.......
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.
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.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-turn-off-a-switch-before-map-transitions.128835/