Stop Combo rather than wait for finish
3 posts
• Page 1 of 1
Stop Combo rather than wait for finish
Completely new to scripting but testing through the examples.
I have quite a long combo setup that start at a button press, loops and then stops looping on another press. All is working fine but I would like the combo to stop completely rather than wait until its finished with the button press.
If I press button 16 the combo finishes and then does not loop again, can I press button 16 and stop the combo midway ?
thanks in advance
I have quite a long combo setup that start at a button press, loops and then stops looping on another press. All is working fine but I would like the combo to stop completely rather than wait until its finished with the button press.
- Code: Select all
main {
if (event_active(BUTTON_16) ) bLoop = !bLoop; // invert the current state with each press TRUE<->FALSE
if (bLoop) combo_run(rotation); // keep the combo playback active as long as bLoop == TRUE
}
combo rotation {
my combo about 25 different buttons in order
}
If I press button 16 the combo finishes and then does not loop again, can I press button 16 and stop the combo midway ?
thanks in advance
-
cifer42 - Private First Class
- Posts: 2
- Joined: Wed Nov 17, 2021 6:11 pm
Re: Stop Combo rather than wait for finish
Maybe if you split up the combo and have a bunch of boolean guards? Someone might be able to think of a more simple way, but that's how I'd do it. While (button) and then chain the boolean guards, and while not button reset all guards.
-
Helic - Private First Class
- Posts: 2
- Joined: Thu Dec 09, 2021 5:15 pm
Re: Stop Combo rather than wait for finish
I found another snippet to stop the combo.
So the complete
Pressing the button again stops the combo.
- Code: Select all
if (event_active(BUTTON_13) )
combo_stop(start);
So the complete
- Code: Select all
main {
if (event_active(BUTTON_13) ) bLoop = !bLoop; // invert the current state with each press TRUE<->FALSE
if (bLoop) combo_run(start); // keep the combo playback active as long as bLoop == TRUE
if (event_active(BUTTON_13) )
combo_stop(start);
};
Pressing the button again stops the combo.
-
cifer42 - Private First Class
- Posts: 2
- Joined: Wed Nov 17, 2021 6:11 pm
3 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 154 guests