Memory Slot Defaults / Reset

GPC2 script programming for Titan Two. Code examples, questions, requests.

Memory Slot Defaults / Reset

Postby UK_Wildcats » Tue Feb 19, 2019 6:33 pm

Normally, I only have 1 memory slot loaded (i.e. my BO4 script in memory Slot #1). Sometimes I have various mods enabled (accidentally or intentional) and want to very quickly clear them out to the defaults. To accomplish this, I just switch memory slots from 1 to 0 and back to 1 using R1 + PS buttons.

The kids are now starting to play more games and I am loading more scripts for them and for testing. Therefore, it is not as easy to switch between the memory slots to get back to the defaults.

I was thinking of adding in an action within the script do this function. I know that I could create a simple script and add it to a memory slot to switch between them. For example, BO4 is on Slot 1 and switch script is Slot 4. The BO4 script action would be to switch to memory Slot #4. The memory Slot #4 script would switch it back to memory Slot #1.

Instead of doing this, is there a command or sequence that would just reset the memory slot in the same way without having to switch between memory slots?
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Re: Memory Slot Defaults / Reset

Postby Scachi » Tue Feb 19, 2019 7:06 pm

Don't know if I understand that correctly what you are trying to do.. that 1 <-> 4 is confusing me..
this should reload the current slot:
Code: Select all
 
init {
  printf("start");
}
 
main {
  if (event_active(BUTTON_18)) mslot_load(mslot_get());
}
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Memory Slot Defaults / Reset

Postby UK_Wildcats » Tue Feb 19, 2019 7:26 pm

By swapping slots it clears out the script and loads the default values. I am assuming that reloading the current slot will do the same thing. I will try it out.
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 99 guests