Variable is not changing

I was running through a deployed version of my game today, making sure everything worked correctly, getting the needed files, when I discovered that one of my events, which was working fine months ago, just stopped. And I haven't touched it since then.

It's basically a character switching common event. When you switch from character A to character B, it saves the x, y, and map id of character A in their own variables. So when you switch back to Character A, you are right where you left them.

For some reason, the variables aren't changing. So in the deployed game, my characters are spawning in the void with the boat while in the testing game the variables won't change despite me moving them.

Only plugins I'm using for this ZE's key mapper and Hime's common event buttons. As for the code...

1616952078946.png

1616952112441.png

1616952139098.png

1616952169968.png

1616952195580.png


The code repeats with every single character, so I'm not going to put twenty pics of the same thing. I just don't understand why this broke. And I checked with another code that saves your location, which still works, so I don't know why this decided to just not work. Any help will be much appreciated.
You can do the following: When starting the Game,
- press F12 to open Debug
- go to "Source"
- in the tree list on the left, look for "js/rpg_objects"
- press Ctrl+F and search for "Game_Variables.prototype.setValue"
- Here you can add breakpoints

Now, when you call your common Event, the Debugger should pause the game when Variables are changed, so you can check if this Comment is called at all and if so, you can read all the variable Ids and new values.
You can do the following: When starting the Game,
- press F12 to open Debug
- go to "Source"
- in the tree list on the left, look for "js/rpg_objects"
- press Ctrl+F and search for "Game_Variables.prototype.setValue"
- Here you can add breakpoints

Now, when you call your common Event, the Debugger should pause the game when Variables are changed, so you can check if this Comment is called at all and if so, you can read all the variable Ids and new values.
That helped a LOT! I needed to reorganize my code so that the leader switches where after the "Check who is leader" Branches. Curious as to why it worked before. Eh. Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/variable-is-not-changing.134847/