Help with +1 in a combo then break combo when = 100

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

Help with +1 in a combo then break combo when = 100

Postby teckx » Wed Sep 08, 2021 6:31 pm

Hello all,

I pulled this script from a previous thread that Mad created.
What I would like to incorporate is an integer? that will gain +1 every time the combo runs . My gameplan is when the count = 100 this combo will no longer run, but a new combo will run since the count is now ==1
example
Code: Select all
combo mlb {
    wait(4000);
    set_val(XB1_LB, 100);
    set_val(XB1_B, 100);
    wait(60);
    wait(1000);
    set_val(XB1_A, 100);
    wait(600);
 [i]  Count + 1;[/i]
 



Code: Select all
 
#include <xb1.gph>
bool toggle;
main {
    if(is_active(XB1_RT)) {
        toggle = !toggle;
    }
    if(toggle) combo_run(mlb);
    else if(mlb) combo_stop(mlb);
}
combo mlb {
    wait(4000);
    set_val(XB1_LB, 100);
    set_val(XB1_B, 100);
    wait(60);
    wait(1000);
    set_val(XB1_A, 100);
    wait(600);
}
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm

Re: Help with +1 in a combo then break combo when = 100

Postby Mad » Wed Sep 08, 2021 9:15 pm

Code: Select all
#include <xb1.gph>
uint8 count;
bool toggle;
main {
    if(event_active(XB1_RT)) toggle = !toggle;
    if(toggle && count < 100) combo_run(mlb);
    else if(mlb) combo_stop(mlb);
}
combo mlb {
    wait(4000);
    set_val(XB1_LB, 100);
    set_val(XB1_B, 100);
    wait(60);
    wait(1000);
    set_val(XB1_A, 100);
    wait(600);
    ++count;
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Help with +1 in a combo then break combo when = 100

Postby teckx » Wed Sep 08, 2021 11:54 pm

Thank you ! Will try this now
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm

Re: Help with +1 in a combo then break combo when = 100

Postby teckx » Thu Sep 09, 2021 1:27 pm

Mad wrote:
Code: Select all
#include <xb1.gph>
uint8 count;
bool toggle;
main {
    if(event_active(XB1_RT)) toggle = !toggle;
    if(toggle && count < 100) combo_run(mlb);
    else if(mlb) combo_stop(mlb);
}
combo mlb {
    wait(4000);
    set_val(XB1_LB, 100);
    set_val(XB1_B, 100);
    wait(60);
    wait(1000);
    set_val(XB1_A, 100);
    wait(600);
    ++count;
}



In theory would this work?

Code: Select all
#include <xb1.gph>
uint8 count;
bool toggle;
main {
    if(event_active(XB1_RT)) toggle = !toggle;
    if(toggle && count < 100) combo_run(mlb);
    else if(mlb) combo_stop(mlb);
 
    if(toggle && count > 100) combo_run(mlb2);
    else if(mlb2) combo_stop(mlb2);
}
combo mlb {
PLACEHOLDER;
PLACEHOLDER;
    ++count;
 }
 
 
combo mlb2 {
PLACEHOLDER;
PLACEHOLDER;
}
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 122 guests