Menu (BUTTON_3) won't loop in combo

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

Menu (BUTTON_3) won't loop in combo

Postby omega_cup » Sun Aug 22, 2021 8:55 am

Hi there,

I can't seem to work out why this won't work.
Solution 1 doesn't work. Menu is pressed the first run, then never again.
Yet in Solution 2, if I put Menu pressing in its own combo, the entire loop I want works (although because each combo is starting the other and stopping itself, once started it endlessly runs until I use Gtuner to unload the Memory Slot. My Hold Y command doesn't stop it).

Plugged into SeriesX. Tried with both the EliteSeries2 and SeriesX Controllers.
Gtuner IV 1.11.3.1
Titan Two 1.11.3.0

Solution 1 (what I want):
Code: Select all
 
bool bEnabled=FALSE;
 
main {
    if (event_active(BUTTON_14)) {
        bEnabled = FALSE;
        if (time_release(BUTTON_14) <= 200) {
            bEnabled = TRUE;
            printf("Test Start");
            combo_run(cMenu);
            }
        }
    }
 
combo cBoost {
    set_val(BUTTON_3,100);             // press Menu
    wait(300);
    set_val(BUTTON_3,0);
    wait(500);
 
    set_val(BUTTON_16,100);         // press A
    wait(150);
    set_val(BUTTON_16,0);
    wait(200);
 
    set_val(BUTTON_10,100);         // press DPad Up
    wait(150);
    set_val(BUTTON_10,0);
    wait(200);
 
    set_val(BUTTON_16,100);         // press A
    wait(150);
    set_val(BUTTON_16,0);
    wait(450);
 
    set_val(STICK_2_X,100);         // step right
    wait(600);
    set_val(STICK_2_X,0);
    wait(100);
 
    set_val(BUTTON_5,100);             // press LT
    wait(2000);
    set_val(BUTTON_5,0);
    wait(100);
 
    set_val(STICK_2_X,-100);         // step left
    wait(700);
    set_val(STICK_2_X,0);
    wait(7000);
}
 


Solution 2 (what I've had to do, albeit reluctantly):
Code: Select all
 
bool bEnabled=FALSE;
 
main {
    if (event_active(BUTTON_14)) {
        bEnabled = FALSE;
        if (time_release(BUTTON_14) <= 200) {
            bEnabled = TRUE;
            combo_run(cMenu);
            }
        }
    }
 
combo cBoost {
    set_val(BUTTON_16,100);         // press A
    wait(150);
    set_val(BUTTON_16,0);
    wait(200);
 
    set_val(BUTTON_10,100);         // press DPad Up
    wait(150);
    set_val(BUTTON_10,0);
    wait(200);
 
    set_val(BUTTON_16,100);         // press A
    wait(150);
    set_val(BUTTON_16,0);
    wait(450);
 
    set_val(STICK_2_X,100);         // step right
    wait(600);
    set_val(STICK_2_X,0);
    wait(100);
 
    set_val(BUTTON_5,100);             // press LT
    wait(2000);
    set_val(BUTTON_5,0);
    wait(100);
 
    set_val(STICK_2_X,-100);         // step left
    wait(700);
    set_val(STICK_2_X,0);
    wait(7000);
 
    combo_run(cMenu);
    combo_stop(cBoost);
}
 
combo cMenu {
    set_val(BUTTON_3,0);             // have to start with this or Menu doesn't press
    wait(300);
    set_val(BUTTON_3,100);             // press Menu
    wait(300);
    set_val(BUTTON_3,0);
    wait(500);
    combo_run(cBoost);
    combo_stop(cMenu);
}
 
User avatar
omega_cup
Staff Sergeant
Staff Sergeant
 
Posts: 11
Joined: Sun Aug 05, 2018 11:36 am

Re: Menu (BUTTON_3) won't loop in combo

Postby Mad » Sun Aug 22, 2021 10:14 pm

Code: Select all
bool bEnabled=FALSE;
 
main {
    if (event_active(BUTTON_14)) {
        bEnabled = FALSE;
        if (time_release(BUTTON_14) <= 200) {
            bEnabled = TRUE;
            printf("Test Start");
        }
    }
    if(bEnabled) combo_run(cBoost);
    else combo_stop(cBoost);
}
 
combo cBoost {
    set_val(BUTTON_3,100);             // press Menu
    wait(300);
    set_val(BUTTON_3,0);
    wait(500);
 
    set_val(BUTTON_16,100);         // press A
    wait(150);
    set_val(BUTTON_16,0);
    wait(200);
 
    set_val(BUTTON_10,100);         // press DPad Up
    wait(150);
    set_val(BUTTON_10,0);
    wait(200);
 
    set_val(BUTTON_16,100);         // press A
    wait(150);
    set_val(BUTTON_16,0);
    wait(450);
 
    set_val(STICK_2_X,100);         // step right
    wait(600);
    set_val(STICK_2_X,0);
    wait(100);
 
    set_val(BUTTON_5,100);             // press LT
    wait(2000);
    set_val(BUTTON_5,0);
    wait(100);
 
    set_val(STICK_2_X,-100);         // step left
    wait(700);
    set_val(STICK_2_X,0);
    wait(7000);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: Baidu [Spider] and 65 guests