How to put rapid fire and quick recharge mod?

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

How to put rapid fire and quick recharge mod?

Postby Racing » Thu Sep 29, 2016 5:32 pm

Hello, someone knows how could put, rapid fire and quick recharge in this script?
Code: Select all
// Use the Xbox One controller on PS4
// View + Menu should active PS4 Touch click
// View triggers the PS4 Share button if held donw for more than half second
// And "Hair-Trigger" MOD
#include <xb1.gph> // for XB1
#include <ps4.gph> // for PS4

bool inhibit_share = FALSE;
#define TRUE           !FALSE

main {
    if(get_val(XB1_P4)) {
        set_val(PS4_CIRCLE, 100);
        set_val(XB1_P4, 0);
    }
   
    if(get_val(XB1_P2)) {
        set_val(PS4_CROSS, 100);
        set_val(XB1_P2, 0);
    }
   
    if(get_val(XB1_VIEW)) {
        if(time_active(XB1_VIEW) < 1000 || inhibit_share) {
            set_val(XB1_VIEW, 0);
            if(get_val(XB1_MENU)) {
                inhibit_share = TRUE;
                set_val(XB1_MENU, 0);
                set_val(PS4_TOUCH, 100);
            }
        }
    } else inhibit_share = FALSE;

    if(get_val(XB1_LT)) {
        set_val(PS4_L2, 100);
    }
    if(get_val(XB1_RT)) {
        set_val(PS4_R2, 100);
    }

}
init {
   port_inhibit_ffb(PORT_USB_B);
}

Thanks in advance.
PS: change from automatic to semiautomatic I have no idea how.
I wish it were normally turned off and be activated by pressing L2 + above to disable L2 + down
User avatar
Racing
Sergeant Major
Sergeant Major
 
Posts: 106
Joined: Thu May 26, 2016 4:18 pm

Re: How to put rapid fire and quick recharge mod?

Postby Scachi » Fri Sep 30, 2016 12:09 am

I don't know what "quick recharge" is meant to be doing.

For rapid fire try this one:

Code: Select all

// Use the Xbox One controller on PS4
// View + Menu should active PS4 Touch click
// View triggers the PS4 Share button if held donw for more than half second
// And "Hair-Trigger" MOD
#include <xb1.gph> // for XB1
#include <ps4.gph> // for PS4

#define TRUE           !FALSE

bool inhibit_share = FALSE;

bool rapid_on = FALSE;
uint8 FIRE_HOLD_RAPID = 20;
uint8 FIRE_WAIT_RAPID = 20;

init {
   port_inhibit_ffb(PORT_USB_B);
}

main {
    if(get_val(XB1_P4)) {
        set_val(PS4_CIRCLE, 100);
        set_val(XB1_P4, 0);
    }
   
    if(get_val(XB1_P2)) {
        set_val(PS4_CROSS, 100);
        set_val(XB1_P2, 0);
    }
   
    if(get_val(XB1_VIEW)) {
        if(time_active(XB1_VIEW) < 1000 || inhibit_share) {
            set_val(XB1_VIEW, 0);
            if(get_val(XB1_MENU)) {
                inhibit_share = TRUE;
                set_val(XB1_MENU, 0);
                set_val(PS4_TOUCH, 100);
            }
        }
    } else inhibit_share = FALSE;

    if(get_val(XB1_LT)) {
        set_val(PS4_L2, 100);
    }
    if(get_val(XB1_RT)) {
        set_val(PS4_R2, 100);
    }
    
     // on / off rapid fire
     if(get_val(PS4_L2) && is_active(PS4_UP)) rapid_on = TRUE;
     else if(get_val(PS4_L2) && is_active(PS4_DOWN)) rapid_on = FALSE;
     // or the one below to toggle on/off with hold L2 + press up (remove the two above then)
     //if(get_val(PS4_L2) && event_active(PS4_UP)) rapid_on = !rapid_on;
    
     // use rapid fire
    if (get_val(PS4_R2) && rapid_on) combo_run(RapidFire);
}

// rapid fire
combo RapidFire {
   set_val(PS4_R2, 100);
   wait(FIRE_HOLD_RAPID);
   set_val(PS4_R2, 0);
   wait(FIRE_WAIT_RAPID);
    set_val(PS4_R2, 0);
}
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: How to put rapid fire and quick recharge mod?

Postby Racing » Fri Sep 30, 2016 12:41 pm

Thanks Scachi, what I mean with quick recharge, is that if it takes a gun to reload 4 seconds, that it takes 2, for example (which is an X value for all weapons).
PS: in this rapid fire script, I have to change anything, if I use with Elite controller?
Thanks in advance.
User avatar
Racing
Sergeant Major
Sergeant Major
 
Posts: 106
Joined: Thu May 26, 2016 4:18 pm

Re: How to put rapid fire and quick recharge mod?

Postby Scachi » Fri Sep 30, 2016 2:03 pm

It should work with any controller as long as the button mapping is correct.

Sorry, I can't help with your quick recharge. You have to look it up if anything like that exists for the game you are looking for. This seems to be very game specific.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: How to put rapid fire and quick recharge mod?

Postby Racing » Fri Sep 30, 2016 2:20 pm

Thanks will try to take as an example your script The division to change the fire mode or there if I can implement as this in Destiny and Borderlands.
User avatar
Racing
Sergeant Major
Sergeant Major
 
Posts: 106
Joined: Thu May 26, 2016 4:18 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 141 guests