rapid fire on/off

GPC1 script programming for Titan One. Code examples, questions, requests.

rapid fire on/off

Postby srbtattoo » Tue Aug 25, 2015 11:54 pm

im trying to make a gears of war ultimate edition script. im not very good at this so i use the visual script. is there a way to have rapid fire turn off and on with button combo or something like it. Also someone made a script for weapon sliding so if i translate the visual script to the regular script will i have to just copy and paste it in there. any support would be appreciated. sorry im noob to this.
User avatar
srbtattoo
Sergeant Major
Sergeant Major
 
Posts: 72
Joined: Wed Apr 15, 2015 10:50 pm

Re: rapid fire on/off

Postby perfecthuntr » Wed Aug 26, 2015 4:47 am

You may be able to setup an on/off toggle in visual scripting using the Logic area. That is going to get REALLY messy in the visual scripting panel most likely though. I would try to have you switch and stick to manual coding. Use the visual scripting to make small snippets of code that you aren't sure about and then convert them to raw GPC code to see how it's done.

For a toggle, we typically do something like this:
Code: Select all
if (get_val(PS4_SHARE) && event_press(PS4_CROSS)) {
    RapidFireOn = !RapidFireOn;
}

if (RapidFireOn && get_val(PS4_R2)) {
    combo_run(RapidFireCombo);
}


The X = !X part basically is a toggle switch. Each time you hold SHARE and then tap CROSS, the rapid fire mod will toggle on and off.
ConsoleTuner Support Team
User avatar
perfecthuntr
Major
Major
 
Posts: 897
Joined: Wed Jan 14, 2015 8:35 am
Location: Tennessee

Re: rapid fire on/off

Postby DUCKMO3W » Sun Mar 18, 2018 1:53 am

I try'd this in a script I'm trying to write and it come up with an error that says """syntax error, unexpected IF 'if, """ and I have been putting like define RT = XB1_RT; for each button that the script uses but it only works in "GtunerIV" if you paste the titan one conversion code at the top of the script to make it work for titan two. So since define isn't for the gtunerIv software what do you use?
User avatar
DUCKMO3W
Sergeant First Class
Sergeant First Class
 
Posts: 22
Joined: Sat Jan 10, 2015 9:29 pm

Re: rapid fire on/off

Postby J2Kbr » Mon Mar 19, 2018 10:07 am

The above script is not complete, here is a full version for it:

Code: Select all
int RapidFireOn;
 
main {
    if (get_val(PS4_SHARE) && event_press(PS4_CROSS)) {
        RapidFireOn = !RapidFireOn;
    }
 
    if (RapidFireOn && get_val(PS4_R2)) {
        combo_run(RapidFireCombo);
    }
}
 
combo RapidFireCombo {
    set_val(RapidFireCombo, 100);
    wait(40);
    set_val(RapidFireCombo, 0);
    wait(30);
    set_val(RapidFireCombo, 0);
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 69 guests