Help with a script

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

Help with a script

Postby Sightblinder » Fri Nov 13, 2020 5:10 pm

This script works awesome but i would like a little tweak.

Request #1
When i trigger a combo i can cancel it by pressing same button again. However i would like to cancel ongoing combo no matter what button i press if there is a combo active.

Request #2
When i start Combo A i can cancel it with button assigned to A. I would like to start combo A and when i press button B it stops A and begins B.

I understand that i cant mix Req 1 and 2 in same script. Im curious how the code looks like

Below is current script

Code: Select all
main {
    if(event_active(PADDLE_3)) {
        if(!LTOP && !RBOTTOM && !RTOP && !LBOTTOM) combo_run(LTOP); // if some_combo not running, run it.
        else combo_stop(LTOP); // else stop
    }
    if(event_active(PADDLE_2)) {
        if(!LTOP && !RBOTTOM && !RTOP && !LBOTTOM) combo_run(RBOTTOM); // if some_combo not running, run it.
        else combo_stop(RBOTTOM); // else stop
    }
    if(event_active(PADDLE_1)) {
        if(!LTOP && !RBOTTOM && !RTOP && !LBOTTOM) combo_run(RTOP); // if some_combo not running, run it.
        else combo_stop(RTOP); // else stop
    }
    if(event_active(PADDLE_4)) {
        if(!LTOP && !RBOTTOM && !RTOP && !LBOTTOM) combo_run(LBOTTOM); // if some_combo not running, run it.
        else combo_stop(LBOTTOM); // else stop
    }
User avatar
Sightblinder
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Jul 31, 2019 6:56 pm

Re: Help with a script

Postby J2Kbr » Sun Nov 15, 2020 3:18 pm

Sightblinder wrote:Request #2
When i start Combo A i can cancel it with button assigned to A. I would like to start combo A and when i press button B it stops A and begins B.

This would be something like this:
Code: Select all
main {
    if(event_active(PADDLE_3)) {
        if(LTOP) {
            combo_stop(LTOP);
        } else {
            if(RTOP) combo_stop(RTOP);
            if(RBOTTOM) combo_stop(RBOTTOM);
            if(LBOTTOM) combo_stop(LBOTTOM);
            combo_run(LTOP);
        }
    }
}
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Help with a script

Postby Sightblinder » Sun Nov 15, 2020 8:26 pm

Thank you very much. works great
User avatar
Sightblinder
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Jul 31, 2019 6:56 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 138 guests