Map transfer causing common events to be unfunctional

An unknown bug is seemingly causing common events to ignore their switches.

In this game, the player must solve puzzles that involve activating switches and traversing tiles of various colors. The player cannot traverse tiles of a different color than the player character. Some Events on the map will activate Switches that change the player to a specific color. The color of a tile is determined by its Terrain Tag, referred to in the images below as the "Tile Suite".
Spoiler: "Dark" color-changing Event
RPGMV_epWOvsDLwN.png

When a color-changing Event is activated, it triggers a Switch that triggers its corresponding Parallel Process Common Event. The purpose of this Common Event is to set the permissions a player has in relation to the passability of each Terrain Tag. The Common Event does this by turning off all other color-changing Switches and then changing the appearance of the player character to match the active color. After this, a series of nested Conditional Branches verifies what Terrain Tags the player is able to traverse and causes the player to step backward if the player enters an impassable Terrain Tag.
Spoiler: "Light" and "Dark" Common Events
RPGMV_a2HhBJkkjU.png

RPGMV_kMUACHN7nq.png

There is one color, "Light", that the player is meant to reset to upon entering a new Map. This is to be achieved by one of two methods:

The first method, which is the one that doesn't freaking work, is a Parallel Process Event present on pretty much every Map called the "Master Initiative", which turns off all color-changing Switches, then turns on the "Light" Switch, then deletes itself afterward. The "Master Initiative" also stores its coordinates into a Variable, which is checked during the second method.
Spoiler: "Master Initiative"
RPGMV_y3NImCIHOr.png

The second method, which works for unknown reasons, is by "resetting the current level", which is achieved by transferring the player to a map with one Parallel Process Event on it that turns off all color-changing Switches, then transfers the player to the coordinates of the "Master Initiative".
Spoiler: "Reset"
RPGMV_wfMCtadXDp.png

An unknown bug causes the player to retain their color mode between Maps, rendering the first method unfunctional. For example, if the player is transferred to the next Map while in "Dark mode", instead of immediately reverting to "Light mode" as they should, the player remains in "Dark mode" and may traverse tiles that have the Terrain Tag associated with "Dark" without activating the appropriate color-changing Event first. Fellow denizens of the RPG Maker forums, please help me defeat this bug.
It is not a bug and it has nothing to do with map transfer. I haven't read through everything or looked at all your screenshots, but I can tell you the very first common event is wrong.

"This Event" only has meaning in a common event when it's directly called from a map event using the Common Event command. When a common event has an autorun or parallel trigger, it has no presence on the map, so no X or Y location, and This Event means nothing.

Common events also don't delete themselves. If it's autorun or parallel, it continually loops until the condition is no longer valid (ie - until the switch you've used as the condition is turned off).

I suggest you rethink your system design, and learn a bit more about event types and triggers.
I haven't read through everything or looked at all your screenshots, but I can tell you the very first common event is wrong.

"This Event" only has meaning in a common event when it's directly called from a map event using the Common Event command. When a common event has an autorun or parallel trigger, it has no presence on the map, so no X or Y location.

Common events also don't delete themselves. If it's autorun or parallel, it continually loops until the condition is no longer valid (ie - until the switch you've used as the condition is turned off).

I suggest you rethink your system design, and learn a bit more about event types and triggers.
Please view everything before responding. I am very aware that Common Events have no presence on the map. The event you are referring to is an on-map event, not a Common Event.
sorry - you were talking about common events and showed that one first.

Why are you turning on a switch AND doing the Common Event call? Use one or the other. I'd probably get rid of the switch, as you don't want it to loop.

Where are you setting the Tile Suite variable? I don't see it anywhere. If it is 0, 1, 6 or 7 (or 0, 2, 6 or 7 for the other event), then your step backwards is never going to be run. You can go into the debugger (F9) to see what the value is.
sorry - you were talking about common events and showed that one first.

Why are you turning on a switch AND doing the Common Event call? Use one or the other. I'd probably get rid of the switch, as you don't want it to loop.

Where are you setting the Tile Suite variable? I don't see it anywhere. If it is 0, 1, 6 or 7 (or 0, 2, 6 or 7 for the other event), then your step backwards is never going to be run. You can go into the debugger (F9) to see what the value is.
Sorry, I should've included that first.
Spoiler: "Tile Suite Check" Common Event
RPGMV_rwzHNQxT3U.png
It stores the Terrain Tag in a Variable. This Common Event is also triggered by the "Master Initiative". Normal tiles are 0 and Dark is 1. The other Terrain Tags are Light 2, Pink 3, Green 4, Goal 6, and Ice 7, but I assume those other Terrain Tags are not necessarily needed to solve this.
What turns on switch 1 aside from the Reset event? Could it just be that that isn't getting turned on initially, so Tile Suite is set to 0?

In fact I wouldn't even do that as a parallel event. I'd just make the Dark and Light common events call that common event right before they start doing their checks. You only need to set the variable immediately before running those, so it makes sense to do it there rather than have it constantly running the whole time you're on the map.

Then you wouldn't need to worry about activating it initially or in the reset event.
What turns on switch 1 aside from the Reset event? Could it just be that that isn't getting turned on initially, so Tile Suite is set to 0?

In fact I wouldn't even do that as a parallel event. I'd just make the Dark and Light common events call that common event right before they start doing their checks. You only need to set the variable immediately before running those, so it makes sense to do it there rather than have it constantly running the whole time you're on the map.

Then you wouldn't need to worry about activating it initially or in the reset event.
If by Switch 1 you mean "Tile Suite Check", the "Master Initiative" triggers it before erasing itself. Note that "Reset" does not do anything other than deactivating all color-changing Switches and fully healing the player before sending them back to the current level (the previous Map).
The "reset" event runs in every map too?, if so, this could be conflicting with the others mechanisms.
The "reset" event runs in every map too?, if so, this could be conflicting wit theh others mechanisms.
The "Reset" Event only occurs when the player is transferred to the only Map containing the "Reset" Event, where the player is transferred if the 'R' key is pressed or if the player's HP is totally depleted.

Put simply, no.
How many Dark Infuser events do you have on the map?

I wonder if you need to reset the player's color mode to light BEFORE transferring to the new map? By the time you get there and the mode is reset, some of those events might already have run.
Hello, could you explain why it is necessary to use command "Common Event..." if you are already using a switch to trigger the event?
How many Dark Infuser events do you have on the map?

I wonder if you need to reset the player's color mode to light BEFORE transferring to the new map? By the time you get there and the mode is reset, some of those events might already have run.
Spoiler: Video Demonstration of Bug
There is only one on each of these Maps.

Hello, could you explain why it is necessary to use command "Common Event..." if you are already using a switch to trigger the event?
It likely isn't necessary, but I thought the redundancy might motivate the Common Event to work more. I'll test without them again and see if it works. EDIT: "Dark Infuser" ceases to function without calling the Common Event. It does not change the player's color if that is removed.
I wonder if you need to reset the player's color mode to light BEFORE transferring to the new map? By the time you get there and the mode is reset, some of those events might already have run.
I just tried this by having that Exit tile with the weird moving arrows turn off all the color-changing switches and then turn on "Light", but this did not alter the results.
It likely isn't necessary, but I thought the redundancy might motivate the Common Event to work more. I'll test without them again and see if it works. EDIT: "Dark Infuser" ceases to function without calling the Common Event. It does not change the player's color if that is removed.
in my experience, a double trigger like that always causes problems because the engine originally was build to either call a common event, or make it a parallel, never both. In earlier makers it was even restricted and you could never call an event if it was set to parrallel (iirc).
I know that some people tried to use this possibility to trick the engine into having strange effects, but they sooner or later always endet up with strange effects.

I don't have time to check through the entire mechanism, but I would suggest that you find a way to have it work without that double trigger. That might require you to split the critical event in two, one that is called and one that is a parallel process however.
RPGMV_1PfrTQgdG8.png
Fixed it by simply swapping the order of these things. No other changes were required and the Parallel Process Common Events work as intended even when directly called and activated via Switch simultaneously, as they should. Otherwise, I don't think the developers would have forced users to choose a Switch for Parallel Process Common Events.

This bug is officially exterminated.
Thread closed

That is very weird! I wish I had the time to experiment and see what's going on there. Glad you were able to come up with a solution.

Original thread: https://forums.rpgmakerweb.com/threads/map-transfer-causing-common-events-to-be-unfunctional.135918/