Need help with a rapidfire script

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

Need help with a rapidfire script

Postby TheBruhhh » Tue Aug 23, 2022 3:33 pm

So I'm basically trying to make a script that , when L2 + d-pad down are held, pressing R2 activates rapidfire. Tried doing it myself using existing scripts but I'm basically clueless :oops:

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

Re: Need help with a rapidfire script

Postby MrBrgv » Tue Aug 23, 2022 5:52 pm

why involve so any steps for activation, why not just hold l2 and double tap down on D pad. wheres your rapid fire script

Code: Select all
 
 
main {
if(get_actual(7) > 10.0)
        {
    if(event_active(10) && time_release(10) < 200)
 
        ****** link your combo rapidfire here *******
 
      }
 
}
User avatar
MrBrgv
Sergeant First Class
Sergeant First Class
 
Posts: 16
Joined: Sun Dec 27, 2020 9:32 pm

Re: Need help with a rapidfire script

Postby TheBruhhh » Tue Aug 23, 2022 7:23 pm

I already have means to turn it on and off, but this is a very specific situation that basically involves keyboard keys via a XIM lol

Code: Select all
combo RapidFire {
    set_val(4, 100);
    wait(rf_hold);
    set_val(4, 0);
    wait(rf_release);
}
User avatar
TheBruhhh
First Sergeant
First Sergeant
 
Posts: 65
Joined: Sun Nov 24, 2019 1:28 pm

Re: Need help with a rapidfire script

Postby MrBrgv » Wed Aug 24, 2022 2:20 am

Code: Select all
 
bool toggle = FALSE;
uint8 rfRelease, rfHold;
 
 
 
main {
if(get_actual(7) > 10.0 && get_actual(10) > 10.0)
        {
    if(event_active(4) < 200)
     toggle = !toggle;       
 
 }
 
    if(toggle && is_active(4)) {
        combo_run(Rapidfire);
    } else if(Rapidfire) {
        combo_stop(Rapidfire);
 
 
}
}
 
combo Rapidfire
{
    set_val(4,100);
    wait(rfHold);
    set_val(4,0);
    wait(rfRelease);
    set_val(4,0);
    wait(0);
}
 
 
 
User avatar
MrBrgv
Sergeant First Class
Sergeant First Class
 
Posts: 16
Joined: Sun Dec 27, 2020 9:32 pm

Re: Need help with a rapidfire script

Postby TheBruhhh » Fri Aug 26, 2022 4:11 pm

The above isn't working as hoped, unfortunately. I do not want rapidfire to toggle. If I'm holding both L2 and d-pad down, I want rapidfire to be active while that button combination is held. So if I think hold the trigger WHILST that combination is held, it will rapidfire. If it's not being held, no rapidfire.

Thanks for any help so far and in advance!
User avatar
TheBruhhh
First Sergeant
First Sergeant
 
Posts: 65
Joined: Sun Nov 24, 2019 1:28 pm

Re: Need help with a rapidfire script

Postby Mad » Fri Aug 26, 2022 10:25 pm

Code: Select all
#include <xb1.gph>
main {
    if(is_active(XB1_LT) && is_active(XB1_DOWN)) {
        if(is_active(XB1_RT)) {
            combo_run(rapidFire);
        }
    }
}
combo rapidFire {
    set_val(XB1_RT, 100);
    wait(40);
    set_val(XB1_RT, 0);
    wait(40);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Need help with a rapidfire script

Postby TheBruhhh » Sun Aug 28, 2022 7:32 pm

Perfect, thanks Mad!
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 145 guests