Multiple Toggling?
5 posts
• Page 1 of 1
Multiple Toggling?
I could use some help with multiple toggling.
Let's say I want to have 4 different toggles in one script, how would I do this?
For example, if I press
BUTTON9 & BUTTON15 - it would run one set of combos & turn off other toggles
BUTTON9 & BUTTON16 - it would run a different set of combos & turn off other toggles
BUTTON9 & BUTTON17 - it would run a different set of combos & turn off other toggles
BUTTON9 & BUTTON18 - it would run a different set of combos & turn off other toggles
Thanks everyone
Let's say I want to have 4 different toggles in one script, how would I do this?
For example, if I press
BUTTON9 & BUTTON15 - it would run one set of combos & turn off other toggles
BUTTON9 & BUTTON16 - it would run a different set of combos & turn off other toggles
BUTTON9 & BUTTON17 - it would run a different set of combos & turn off other toggles
BUTTON9 & BUTTON18 - it would run a different set of combos & turn off other toggles
Thanks everyone
-
Kidd23 - Sergeant First Class
- Posts: 16
- Joined: Wed Dec 19, 2018 6:50 pm
Re: Multiple Toggling?
- Code: Select all
#pragma METAINFO("Multiple Toggles example", 1, 0, "Haures")
bool toggle_combo1=FALSE;
bool toggle_combo2=FALSE;
bool toggle_combo3=FALSE;
main {
if (get_actual(BUTTON_9) && event_active(BUTTON_15)) { //BUTTON_9=LS(L3) + BUTTON_15=B(Circle)
toggle_combo1 = !toggle_combo1;
}
if(toggle_combo1) {
combo_run(ComboA);
}
//-------------------------------------------------//
if (get_actual(BUTTON_9) && event_active(BUTTON_16)) { //BUTTON_9=LS(L3) + BUTTON_16=A(Cross)
toggle_combo2 = !toggle_combo2;
}
if(toggle_combo2) {
combo_run(ComboB);
}
//-------------------------------------------------//
if (get_actual(BUTTON_9) && event_active(BUTTON_17)) { //BUTTON_9=LS(L3) + BUTTON_17=X(Square)
toggle_combo3 = !toggle_combo3;
}
if(toggle_combo3) {
combo_run(ComboC);
}
}
combo ComboA {
set_val(BUTTON_15, 0.00);
set_val(BUTTON_16, 0.00);
set_val(BUTTON_17, 0.00);
wait(50);
set_val(BUTTON_15, 0.00);
set_val(BUTTON_16, 100.00);
set_val(BUTTON_17, 0.00);
wait(50);
}
combo ComboB {
set_val(BUTTON_15, 0.00);
set_val(BUTTON_16, 0.00);
set_val(BUTTON_17, 0.00);
wait(50);
set_val(BUTTON_15, 0.00);
set_val(BUTTON_16, 0.00);
set_val(BUTTON_17, 100.00);
wait(100);
}
combo ComboC {
set_val(BUTTON_15, 0.00);
set_val(BUTTON_16, 0.00);
set_val(BUTTON_17, 0.00);
wait(25);
set_val(BUTTON_15, 0.00);
set_val(BUTTON_16, 100.00);
set_val(BUTTON_17, 0.00);
wait(25);
}
Thats what i did in my first script and it worked (im new to programming and the Titan Two)
But this script does not turn off the other toggles.
Maybe somebody with more knowlegde can help there.
- Haures
- Sergeant First Class
- Posts: 16
- Joined: Thu Sep 16, 2021 2:59 pm
- Location: Germany
Re: Multiple Toggling?
Haures wrote:But this script does not turn off the other toggles.
Maybe somebody with more knowlegde can help there.
When you activate one toggle you want to disable the others?
- Code: Select all
if (get_actual(BUTTON_9) && event_active(BUTTON_15)) { //BUTTON_9=LS(L3) + BUTTON_15=B(Circle)
toggle_combo1 = !toggle_combo1;
if(toggle1_combo) {
toggle_combo2 = FALSE;
toggle_combo3 = FALSE;
if(ComboB) combo_stop(ComboB);
if(ComboC) combo_stop(ComboC);
}
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
Re: Multiple Toggling?
Mad wrote:When you activate one toggle you want to disable the others?
Kidd23 wrote:For example, if I press
BUTTON9 & BUTTON15 - it would run one set of combos & turn off other toggles
BUTTON9 & BUTTON16 - it would run a different set of combos & turn off other toggles
BUTTON9 & BUTTON17 - it would run a different set of combos & turn off other toggles
BUTTON9 & BUTTON18 - it would run a different set of combos & turn off other toggles
Thats what Kidd23 wanted i think?
Yeah thanks, i appreciate your help Mad.
(sorry for maybe bad english, im german)
- Haures
- Sergeant First Class
- Posts: 16
- Joined: Thu Sep 16, 2021 2:59 pm
- Location: Germany
Re: Multiple Toggling?
That's exactly what I needed, thank you so much
-
Kidd23 - Sergeant First Class
- Posts: 16
- Joined: Wed Dec 19, 2018 6:50 pm
5 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: midg3t2 and 213 guests