script command to change memory slots?
10 posts
• Page 1 of 1
script command to change memory slots?
I'm trying to write a script where at the end of the script it changes the Memory slot. How would I do this?
Example: I press start which activates my combo then at the end of the combo I would like it to change memory slot 2 .
I have tried the G8 alternate command to change the memory slot by writing LS+ home button into my script. But for some reason the controller will only change the slot and the script will not.
any help would be much appreciated
Example: I press start which activates my combo then at the end of the combo I would like it to change memory slot 2 .
I have tried the G8 alternate command to change the memory slot by writing LS+ home button into my script. But for some reason the controller will only change the slot and the script will not.
any help would be much appreciated
-
Rapture - Sergeant First Class
- Posts: 19
- Joined: Sat Feb 04, 2017 8:57 pm
-
xenologer - Command Sergeant Major
- Posts: 147
- Joined: Thu Dec 29, 2016 12:31 am
Re: script command to change memory slots?
complementing xenologer post, what you need to do is use load_slot(x); at the end of the combo, where x is the memory slot number you want load.
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: script command to change memory slots?
Is there a command that will tell the Titan 1 to change slots Without giving a specific Number? I just want the Titan to Change slots 123456789 then back to 1.
-
Rapture - Sergeant First Class
- Posts: 19
- Joined: Sat Feb 04, 2017 8:57 pm
Re: script command to change memory slots?
Use the max function along with the modulus operator for a nice one line solution:
EDIT:
I just checked and I guess there isn't a max function.
You'd have to do something like this:
(Not a one line solution, unfortunately GPC doesn't support the ternary operator)
- Code: Select all
load_slot(max(1, (get_slot() + 1) % 9));
EDIT:
I just checked and I guess there isn't a max function.
You'd have to do something like this:
- Code: Select all
if (get_slot() > 8)
{
load_slot(1);
}
else
{
load_slot(get_slot() + 1);
}
(Not a one line solution, unfortunately GPC doesn't support the ternary operator)
-
PaulaTheKoala - Command Sergeant Major
- Posts: 131
- Joined: Wed Aug 26, 2015 3:45 am
Re: script command to change memory slots?
PaulaTheKoala wrote:Use the max function along with the modulus operator for a nice one line solution:
- Code: Select all
load_slot(max(1, (get_slot() + 1) % 9));
EDIT:
I just checked and I guess there isn't a max function.
You'd have to do something like this:
- Code: Select all
if (get_slot() > 8)
{
load_slot(1);
}
else
{
load_slot(get_slot() + 1);
}
(Not a one line solution, unfortunately GPC doesn't support the ternary operator)
IT WORKED!!! YOU ARE THE BEST EVER THANKS FOR THE HELP
-
Rapture - Sergeant First Class
- Posts: 19
- Joined: Sat Feb 04, 2017 8:57 pm
Re: script command to change memory slots?
PaulaTheKoala wrote:Use the max function along with the modulus operator for a nice one line solution:
- Code: Select all
load_slot(max(1, (get_slot() + 1) % 9));
EDIT:
I just checked and I guess there isn't a max function.
Hey J2Kbr
it would really be Helpful if there Was a function to Query the Titanone for the current number of Slots downloaded.
Or if performing load_slot() on an Empty slot could have an Alternative default to slot1 instead of Null Slot. -if it defaulted to a location I had control of, at least I could program a way to handle it nicely, or even use that to runtime determine the number of slots...
True, I could just hardcode the Number of Slots Used at Compile time, but suppose I want to create a series of modular scripts that work together in a plug-in-play fashion for other's to use? Can't expect them to go and do that ...
-
xenologer - Command Sergeant Major
- Posts: 147
- Joined: Thu Dec 29, 2016 12:31 am
Re: script command to change memory slots?
Hi xenologer. I have just replied your PM, here is a copy:
--
The Titan Two has this capability and we can include that on the Titan One as well. I will add your request to the Gtuner Pro GitHub and you can expect to have it available for the next software and firmware update. Thanks for you suggestion.
--
The Titan Two has this capability and we can include that on the Titan One as well. I will add your request to the Gtuner Pro GitHub and you can expect to have it available for the next software and firmware update. Thanks for you suggestion.
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: script command to change memory slots?
Is there a way to put that on a toggle or somthing like LT + dpad up somthing like that??
-
DUCKMO3W - Sergeant First Class
- Posts: 22
- Joined: Sat Jan 10, 2015 9:29 pm
Re: script command to change memory slots?
DUCKMO3W wrote:Is there a way to put that on a toggle or somthing like LT + dpad up somthing like that??
with GPC scripts this can be achieved with this code:
- Code: Select all
main {
if(get_val(XB1_LT) && event_press(XB1_UP)) {
load_slot(get_slot()+1);
}
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
10 posts
• Page 1 of 1
Return to GPC1 Script Programming
Who is online
Users browsing this forum: No registered users and 74 guests