[RMMV] Clear self-switches on loading game

Status
Not open for further replies.

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
333
Reaction score
92
First Language
English
Primarily Uses
N/A
I know you can clear all the self-switches in the game with the script call

$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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
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?
 

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
333
Reaction score
92
First Language
English
Primarily Uses
N/A
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.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
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.
 

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
333
Reaction score
92
First Language
English
Primarily Uses
N/A
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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
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?
 

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
333
Reaction score
92
First Language
English
Primarily Uses
N/A
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."
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,565
Reaction score
8,638
First Language
English
Primarily Uses
RMMV

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.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Since I started in this world of make games, It's hard for me to enjoy playing a game. It's like, coding and make it work, sounds like I'm playing and have fun o_O
Not sure if it's true (and I won't judge or blame anyone if it is, really), but I heard from confident sources that you guys (and girls) really really like to
How is this new year for everyone? Hope you are well. Still deep in Covid in the US. Its like a vampire and refuses to die with even more strains. I need some holy water to kill it with.
in my game, what's known as HeadSpace is combining with the real world...
oh looks like the forums updated while I wasn't looking and we can put a banner now. Neat!

Forum statistics

Threads
107,666
Messages
1,031,274
Members
139,790
Latest member
TransDiv
Top