[RMMV] Clear self-switches on loading game

I know you can clear all the self-switches in the game with the script call

Spoiler
$gameSelfSwitches.clear();

But I was wondering how (if possible) to clear all self-switches - either in the whole game or just on the map you're located - when you load the game?
Go open the base JS files, find the function that processes loading, and add that script call to it...

On another note, why would you want to do it upon loading?
Go open the base JS files, find the function that processes loading, and add that script call to it...

On another note, why would you want to do it upon loading?

Thank you! What are the base JS files and how do I add the script call? I want to do it so the events on the maps reset, that way the player isn't soft blocked.
Why not just reset them on map load then? You know like have a parallel process event on the map, make it reset self switches, then erase event so it doesnt run until next time...

Anyway, the base JS files are the files inside the JS folder of your game.. Adding the script call is just that, add that exact line to the appropriate place in the JS file.
Why not just reset them on map load then? You know like have a parallel process event on the map, make it reset self switches, then erase event so it doesnt run until next time...

Anyway, the base JS files are the files inside the JS folder of your game.. Adding the script call is just that, add that exact line to the appropriate place in the JS file.

Thank you! Would the parallel process run when the game is loaded? I thought parallel process only works when the map is loaded?
Depends on how you set it.. By default, parallel process, run ALWAYS...

If you follow my method and add an erase event at the end, it will only run once every time you go to that map, before anything is shown. It wont run if you save, quit then load that file, unless you edit the game first which will force a map update upon loading.

Do you really need it only during save file loading? and Why?
Depends on how you set it.. By default, parallel process, run ALWAYS...

If you follow my method and add an erase event at the end, it will only run once every time you go to that map, before anything is shown. It wont run if you save, quit then load that file, unless you edit the game first which will force a map update upon loading.

Do you really need it only during save file loading? and Why?

Thank you, I'll do that! I'm having loading problems. Whenever I load, the events on the maps don't reset, so music won't play, can't talk to NPCs, etc. Same thing happens when I try new game - the events, variables, and switches aren't reset but somehow still "saved."

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-clear-self-switches-on-loading-game.109677/