[Multi-Platform] Anti-Recoil + Rapid Fire ~OFFICIAL PAGE~

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

Re: [Multi-Platform] Anti-Recoil + Rapid Fire ~OFFICIAL PAGE

Postby zgigi666999 » Wed Jan 20, 2016 5:16 am

When i load the script gtuner and maxi aim di crash anyone can help
User avatar
zgigi666999
Sergeant First Class
Sergeant First Class
 
Posts: 17
Joined: Wed Jan 13, 2016 1:22 pm

Re: [Multi-Platform] Anti-Recoil + Rapid Fire ~OFFICIAL PAGE

Postby J2Kbr » Wed Jan 20, 2016 10:37 am

zgigi666999 wrote:When i load the script gtuner and maxi aim di crash anyone can help

Please provide more details about this crash ... if possible, a step-by-step procedure, so we can try reproduce. Thanks.
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: [Multi-Platform] Anti-Recoil + Rapid Fire ~OFFICIAL PAGE

Postby NOM4D » Wed Jan 20, 2016 1:04 pm

zgigi666999 wrote:When i load the script gtuner and maxi aim di crash anyone can help


This happen becouse Max-Aim doesn't support SPVARs (Private Persistent Variable), that are used to save and load run-time configurations.
As JaggedDiamond kindly wrote in the description of the script, If you want to use it with mouse and keyboard, you must comment out any line which has "SPVAR" in it.
User avatar
NOM4D
Master Sergeant
Master Sergeant
 
Posts: 39
Joined: Tue Nov 25, 2014 2:00 pm

Re: [Multi-Platform] Anti-Recoil + Rapid Fire ~OFFICIAL PAGE

Postby kido12 » Fri Sep 18, 2020 12:39 pm

i love it .. but haw to fire whit R1 and aim L1 ? is it possibel .. thank you . i am playing on ps4 ..
User avatar
kido12
Private
Private
 
Posts: 1
Joined: Fri Sep 18, 2020 12:34 pm

Re: [Multi-Platform] Anti-Recoil + Rapid Fire ~OFFICIAL PAGE

Postby Mad » Fri Sep 18, 2020 8:22 pm

kido12 wrote:i love it .. but haw to fire whit R1 and aim L1 ? is it possibel .. thank you . i am playing on ps4 ..

I have manually changed the buttons for you:
Code: Select all
// GPC Online Library
// multiplatform_antirecoil__rapid_fire.gpc
 
/* *
Features; Rapid Fire (Adjustable), Anti-Recoil Vertical + Horizontal
 
Author:     JaggedDiamond                   
System:     MULTI
Controller: MULTI - Optimized for MOUSE & KEYBOARD
GAME:       Battlefield series - COD series - Black Ops series
 
************************************************************/

define ONLY_WITH_SCOPE = TRUE;// Use Anti-recoil only when scoping
define ANTI_RECOIL = 0;       //change "0" to compensate vertical recoil (0 - 100)
define ANTI_RECOIL_LEFT = 0//change this value to compensate to the left (0 - 100)
define ANTI_RECOIL_RIGHT = 0; //change this value to compensate to the right (0 - 100)
 
/* *
*  SIMPLE RAPID FIRE
* *************************************************************************** */

 
define RAPIDFIRE_BUTTON = PS4_R1;
 
define RATE_OF_FIRE = 16;   // Range: 1 to 25 RPS (Round/s) between 16 and 18, rapid fire works best if you are planning on using it for the Five-Seven in BO2
                            // Values higher than 25 would be so fast that the
                            // Game probably will not detect 100% of the events.
 
///////////////////////////////////////////////////////////////////////////////////////////
int anti_recoil;
int anti_recoil_left;
int anti_recoil_right;
 
int hold_time, rest_time;
 
init {
    hold_time = 500 / RATE_OF_FIRE;
    rest_time = hold_time - 20;
    if(rest_time < 0) rest_time = 0;
}
 
main {
    if(get_val(PS4_L1) && get_val(PS4_R1)) {
        combo_run(AntiRecoil);
    }
 
    if(get_val(RAPIDFIRE_BUTTON)) {
        combo_run(RapidFire);
    } else if(combo_running(RapidFire)) {
        combo_stop(RapidFire);
    }
}
 
combo RapidFire {
    set_val(RAPIDFIRE_BUTTON, 100);
    wait(hold_time);
    set_val(RAPIDFIRE_BUTTON, 0);
    wait(rest_time);
    set_val(RAPIDFIRE_BUTTON, 0);
}
 
combo AntiRecoil { // This combo must be the last one
    anti_recoil = get_val(10) + ANTI_RECOIL;
    if(anti_recoil > 100) anti_recoil = 100;
    set_val(10, anti_recoil);
    anti_recoil_left = get_val(9) -ANTI_RECOIL_LEFT;
    if(anti_recoil_left > 100) anti_recoil_left = 100;
    set_val(9, anti_recoil_left);
    anti_recoil_right = get_val(9) +ANTI_RECOIL_RIGHT;
    if(anti_recoil_right > 100) anti_recoil_right = 100;
    set_val(9, anti_recoil_right);
}

You can also use the maxremapper plugin. :smile0517:
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4532
Joined: Wed May 22, 2019 5:39 am

Re: [Multi-Platform] Anti-Recoil + Rapid Fire ~OFFICIAL PAGE

Postby toast » Sat Apr 17, 2021 4:31 pm

I play southpaw on XB1. (aim with left stick, move with right). I also play inverted. Yeah, yeah, i know... But its because the first FPS i played on console was Golden eye on the N64 which had the aiming stick on the left thumb... Yeah, yeah, I'm old. What do i need to change to get this script working for my backwards brain? I suppose i can just use negative values to solve the inverted issue, but how do i get anti recoil to work on the left stick instead of the right?

Cheers

Code: Select all
//DECLARARATIONS - define
 
define AR_Release = 70; // change this value to determine when antirecoil stops working (min: antirecoil value)
define ONLY_WITH_SCOPE = TRUE; // if TRUE Antirecoil IS ON only when scoping
 
define RECOIL_UP = 13;     
define RECOIL_DOWN = 14;   
define RECOIL_LEFT  = 15;
define RECOIL_RIGHT = 16
 
//-------------------------------------------------------------------------------------------
 
//VARIABLES - int
 
int fire_button;
int scope_button;
int hold_time;
int rest_time;
int recoil_onoff = TRUE; // if TRUE ANTIRECOIL is ON by default - if FALSE, OFF by default
int rapid_onoff = TRUE; // if TRUE RAPIDFIRE is ON by default - if FALSE, OFF by default
int RATE_OF_FIRE = 13; //Range: 1 to 25 RPS (Round/s)
int ANTI_RECOIL = 30;
int ANTI_RECOIL_H = 0
int anti_recoil;
int anti_recoil_H;
 
//-------------------------------------------------------------------------------------------
 
//INITIALIZATION - init
 
init{
 
    if(get_console() == PIO_PS3) {
        fire_button = 3;
        scope_button = 6;
    }else {
        fire_button = 4;
        scope_button = 7;
    }
    RATE_OF_FIRE = get_pvar(SPVAR_1,0, 250, 13);
    ANTI_RECOIL = get_pvar(SPVAR_2,0,100,30);
    ANTI_RECOIL_H = get_pvar(SPVAR_3,0,100,0);
}
 
//-------------------------------------------------------------------------------------------
 
//MAIN BLOCK ROUTINES
 
main {
    if(get_val(7)  && event_press(20))  {
        combo_run(vibrate); recoil_onoff=!recoil_onoff;
        }
    if(get_val(7)) {if(event_press(19))  {
        combo_run(vibrate);rapid_onoff=!rapid_onoff;}
        }   
    if(rapid_onoff) {if(get_val(4)) {combo_run(RAPID_FIRE);
        }
    }     
        hold_time = 500 / RATE_OF_FIRE;
        rest_time = hold_time - 20;
        if(rest_time < 0) rest_time = 0;
 
    if(get_val(19)){ 
        if(event_press(13)){
            RATE_OF_FIRE = RATE_OF_FIRE +1;
        }
        if(event_press(14)){
            RATE_OF_FIRE = RATE_OF_FIRE -1;
        }
        set_val(13,0);set_val(14,0);
    }
 
    if(get_val(scope_button) && event_press(2)){
        set_pvar(SPVAR_1,RATE_OF_FIRE);
        set_val(2,0);
    }
    if(get_val(7)){
        if(event_press(RECOIL_UP)){
            ANTI_RECOIL = ANTI_RECOIL + 1;
        }
        if(event_press(RECOIL_DOWN)) {
            ANTI_RECOIL = ANTI_RECOIL - 1;
        }
        set_val(RECOIL_UP,0);
        set_val(RECOIL_DOWN,0);
 
        if(event_press(RECOIL_LEFT)){
            ANTI_RECOIL_H = ANTI_RECOIL_H + 1;
        }
        if(event_press(RECOIL_RIGHT)) {
            ANTI_RECOIL_H = ANTI_RECOIL_H - 1;
        }
        set_val(RECOIL_LEFT,0);
        set_val(RECOIL_RIGHT,0);
 
        if(event_press(17)){
        set_pvar(SPVAR_2, ANTI_RECOIL);
        set_pvar(SPVAR_3, ANTI_RECOIL_H);
        }
    }
    if(!ONLY_WITH_SCOPE || get_val(scope_button) && get_val(fire_button )) {
        combo_run(AntiRecoil);
    }
    if ((get_val(10) <-AR_Release) || (get_val(10) > AR_Release) || (get_val(9) <-AR_Release) || (get_val(9) > AR_Release)) {
                combo_stop (AntiRecoil);
    }
}
//-------------------------------------------------------------------------------------------
 
//COMBO BLOCKS
 
combo vibrate   {
    set_rumble(RUMBLE_A, 100);
    wait(300);
    reset_rumble();
    }
 
combo RAPID_FIRE {
    set_val(fire_button, 100);
    wait(hold_time);
    set_val(fire_button, 0);
    wait(rest_time);
    set_val(fire_button, 0);
    }
combo AntiRecoil { // This combo must be the last one
    if(recoil_onoff) {
    anti_recoil = get_val(10) + ANTI_RECOIL;
    if(anti_recoil > 100) anti_recoil = 100;
    set_val(10, anti_recoil);
    anti_recoil_H = get_val(9) +ANTI_RECOIL_H;
    if(anti_recoil_H > 100) anti_recoil_H = 100;
    set_val(9, anti_recoil_H);
    }
} // End
 
 
User avatar
toast
Sergeant First Class
Sergeant First Class
 
Posts: 19
Joined: Sat Jul 18, 2020 5:48 pm

Re: [Multi-Platform] Anti-Recoil + Rapid Fire ~OFFICIAL PAGE

Postby toast » Sun Apr 18, 2021 1:18 am

never mind. worked it out. realized the values in the anti recoil combo represent buttons. trial and error to work out left stick.
is there a reference for these numbers somewhere? couldnt find it.
For anyone who want to do the same here is the code you need to change:

Code: Select all
combo AntiRecoil { // This combo must be the last one
    if(recoil_onoff) {
    anti_recoil = get_val(12) + ANTI_RECOIL;
    if(anti_recoil > 100) anti_recoil = 100;
    set_val(12, anti_recoil);
    anti_recoil_H = get_val(11) +ANTI_RECOIL_H;
    if(anti_recoil_H > 100) anti_recoil_H = 100;
    set_val(11, anti_recoil_H);
    }
User avatar
toast
Sergeant First Class
Sergeant First Class
 
Posts: 19
Joined: Sat Jul 18, 2020 5:48 pm

Previous

Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 49 guests