Repeating combo while left stick is pegged forward

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

Repeating combo while left stick is pegged forward

Postby TheBruhhh » Mon Dec 05, 2022 2:13 am

Code: Select all
combo YY {      
    set_val(13, 100.0);
    wait(39);
    set_val(13, 0.0);
    wait(39);
    set_val(13, 100.0);
    wait(39);
    set_val(13, 0.0);
    wait(39);
}


I'm looking to get the above combo to keep repeating all the while the left analog stick is pegged all the way forwards. Also, looking to have it stop repeating when L2 or R2 are held, but if this happens when the combo is in progress, it must finish playing before it stops repeating.

Any help appreciated :wink:
User avatar
TheBruhhh
First Sergeant
First Sergeant
 
Posts: 65
Joined: Sun Nov 24, 2019 1:28 pm

Re: Repeating combo while left stick is pegged forward

Postby Scachi » Mon Dec 05, 2022 10:22 am

Code: Select all
main {
    if (get_val(STICK_2_Y) <= -95.0) {
        if (!get_val(BUTTON_5) && !get_val(BUTTON_8)) combo_run(YY);
    }
}
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Repeating combo while left stick is pegged forward

Postby TheBruhhh » Sun Dec 11, 2022 1:52 am

Scachi wrote:
Code: Select all
main {
    if (get_val(STICK_2_Y) <= -95.0) {
        if (!get_val(BUTTON_5) && !get_val(BUTTON_8)) combo_run(YY);
    }
}


Sorry for the mega late reply, been a busy week, just got to try this finally, perfect, thanks!!! :smile0517:
User avatar
TheBruhhh
First Sergeant
First Sergeant
 
Posts: 65
Joined: Sun Nov 24, 2019 1:28 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 97 guests