Anti Recoil Script

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

Anti Recoil Script

Postby Timmyk22 » Wed Oct 24, 2018 9:52 pm

I want to use an anti recoil script with my mouse and keyboard setup with the titan 2. However when I put it on and start to shoot it pulls the gun down extremely fast and just aims at the ground. Is there a fix for something like this or is it impossible because of the sensor on the mouse?
User avatar
Timmyk22
First Sergeant
First Sergeant
 
Posts: 48
Joined: Wed Sep 20, 2017 1:31 pm

Re: Anti Recoil Script

Postby bonefisher » Wed Oct 24, 2018 10:36 pm

What script are you using? Sounds like you need to adjust settings in the anti-recoil.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Anti Recoil Script

Postby Sillyasskid » Wed Oct 24, 2018 10:38 pm

I'm just going to assume you were using an anti recoil script that was made for the attended use of a controller, is this Correct?

Also,
What game or games are you playing / want anti-recoil for ?,

Setting up anti-recoil for use with the mouse is fairly simple, but first I need to know how is the mouse connected to the T2.

Directly with the T2?
Or through a Xim Device?
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Anti Recoil Script

Postby Timmyk22 » Thu Oct 25, 2018 12:12 am

it is connected directly, running 12,000 dpi. I do believe it was for a controller also. Not sure how to write one for a mouse connected to a titan 2. The games I play are call of duty and rainbow six siege, so i guess id be looking for more of a universal script.
User avatar
Timmyk22
First Sergeant
First Sergeant
 
Posts: 48
Joined: Wed Sep 20, 2017 1:31 pm

Re: Anti Recoil Script

Postby bonefisher » Thu Oct 25, 2018 1:31 am

Code: Select all
 
#define vertical    20.00 //adjust anti-recoil: add if gun is rising and subtract if dropping.
#define horizontal   0.00 //adjust anti-recoil right and left: add positive number if going left
                          //and add a - in front of number if going right.
 
bool rapid_fire_toggle;
bool anti_recoil_toggle;
fix32  noise;
init{noise = 7.0;}
 
main {
//-------------------------Remove stick noise---------------------------------//
    if(abs(get_actual(STICK_1_X)) < noise) set_val(STICK_1_X, 0.0);
    if(abs(get_actual(STICK_1_Y)) < noise) set_val(STICK_1_Y, 0.0);
    if(abs(get_actual(STICK_2_X)) < noise) set_val(STICK_2_X, 0.0);
    if(abs(get_actual(STICK_2_Y)) < noise) set_val(STICK_2_Y, 0.0);
//-------------------------Anti-recoil toggle---------------------------------//
/*        To turn anti-recoil on/off hold ADS trigger and click d-pad down       */   
    if(get_actual(BUTTON_8)){
        set_val(BUTTON_11, 0.0);
    if(event_active(BUTTON_11)) {
        anti_recoil_toggle = (anti_recoil_toggle == 0?1:0);}}
//----------------------------------------------------------------------------//
    if(anti_recoil_toggle){
    if(get_actual(BUTTON_5))combo_run(anti_recoil);
    if(is_active(STICK_1_Y))combo_stop(anti_recoil);
    if(is_active(STICK_1_X))combo_stop(anti_recoil);}
//-------------------------Rapid fire toggle----------------------------------//
/*        To turn rapid fire on/off hold ADS trigger and click d-pad up       */   
    if(get_actual(BUTTON_8)){
        set_val(BUTTON_10, 0.0);
    if(event_active(BUTTON_10)) {
        rapid_fire_toggle = (rapid_fire_toggle == 0?1:0);}}
//----------------------------------------------------------------------------//    
    if(rapid_fire_toggle && get_actual(BUTTON_5))combo_run(rapid_fire);
}
combo rapid_fire
{
    set_val(BUTTON_5, 100.0);
    wait(60);
    set_val(BUTTON_5, 0.0);
    wait(60);
    set_val(BUTTON_5, 0.0);
}
 
combo anti_recoil
{
    set_val(STICK_1_Y, vertical);
    set_val(STICK_1_X, horizontal);
}
 

Use a input translator for the game your playing and add to slot with this. Adjust the anti-recoil at top of script. Turning on/off anti-recoil hold ads trigger then click d-pad down and for rapid fire hold ads trigger and click d-pad up. This is used for anything...... :smile0517:
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Anti Recoil Script

Postby J2Kbr » Thu Oct 25, 2018 4:48 am

Timmyk22 wrote:it is connected directly, running 12,000 dpi. I do believe it was for a controller also. Not sure how to write one for a mouse connected to a titan 2. The games I play are call of duty and rainbow six siege, so i guess id be looking for more of a universal script.

In case of using the mouse direct connected to the Titan Two the GPC script language has a handy function that is perfect for anti-recoil with mouse: mxyconverter_voffset()

Here is an example on how to use this function:
Code: Select all
main {
    if(event_active(BUTTON_5)) {
        mxyconverter_voffset(29); // ANTI-RECOIL
    } else if(event_release(BUTTON_5)) {
        mxyconverter_voffset(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

Re: Anti Recoil Script

Postby bonefisher » Thu Oct 25, 2018 8:25 am

Code: Select all
 
#include <mouse.gph>
 
#define vertical_compensation 24 //pull force
 
init {
    const uint8 mmap[] = {
        MOUSE_X,            STICK_1_X,
        MOUSE_Y,            STICK_1_Y,
        MWHEEL_FORWARD,     BUTTON_17,
        MWHEEL_BACKWARD,    BUTTON_6,
        MBUTTON_1,          BUTTON_5,
        MBUTTON_2,          BUTTON_8,
        MBUTTON_3,          BUTTON_14,
        MBUTTON_4,          BUTTON_15,
        MBUTTON_5,          BUTTON_16,
    }; mousemapping(mmap);
}
main {
    if(event_active(BUTTON_5)) {
        mxyconverter_voffset(vertical_compensation);
    } else if(event_release(BUTTON_5)) {
        mxyconverter_voffset(0);
    }
    if(is_active(STICK_1_Y)){mxyconverter_voffset(0);
    }else if(is_release(STICK_1_Y) && is_active(BUTTON_5)){
        mxyconverter_voffset(vertical_compensation);
    }
    if(is_active(STICK_1_X)){mxyconverter_voffset(0);
    }else if(is_release(STICK_1_X) && is_active(BUTTON_5)){
        mxyconverter_voffset(vertical_compensation);
    }
}
 

Here the fix J2Kbr on that recoil! If your going slow and the way you have it is fine but when turn fast using it gets a downward curve to it so this fix puts it precise on! :smile0517:
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Anti Recoil Script

Postby Timmyk22 » Thu Oct 25, 2018 1:48 pm

Awesome! I'll give it a try sometime today, thanks.
User avatar
Timmyk22
First Sergeant
First Sergeant
 
Posts: 48
Joined: Wed Sep 20, 2017 1:31 pm

Re: Anti Recoil Script

Postby itsPANDA » Wed Sep 25, 2019 4:00 am

bonefisher wrote:
Code: Select all
 
#include <mouse.gph>
 
#define vertical_compensation 24 //pull force
 
init {
    const uint8 mmap[] = {
        MOUSE_X,            STICK_1_X,
        MOUSE_Y,            STICK_1_Y,
        MWHEEL_FORWARD,     BUTTON_17,
        MWHEEL_BACKWARD,    BUTTON_6,
        MBUTTON_1,          BUTTON_5,
        MBUTTON_2,          BUTTON_8,
        MBUTTON_3,          BUTTON_14,
        MBUTTON_4,          BUTTON_15,
        MBUTTON_5,          BUTTON_16,
    }; mousemapping(mmap);
}
main {
    if(event_active(BUTTON_5)) {
        mxyconverter_voffset(vertical_compensation);
    } else if(event_release(BUTTON_5)) {
        mxyconverter_voffset(0);
    }
    if(is_active(STICK_1_Y)){mxyconverter_voffset(0);
    }else if(is_release(STICK_1_Y) && is_active(BUTTON_5)){
        mxyconverter_voffset(vertical_compensation);
    }
    if(is_active(STICK_1_X)){mxyconverter_voffset(0);
    }else if(is_release(STICK_1_X) && is_active(BUTTON_5)){
        mxyconverter_voffset(vertical_compensation);
    }
}
 

Here the fix J2Kbr on that recoil! If your going slow and the way you have it is fine but when turn fast using it gets a downward curve to it so this fix puts it precise on! :smile0517:



Can this work for controller?
User avatar
itsPANDA
Sergeant
Sergeant
 
Posts: 6
Joined: Wed Sep 25, 2019 3:57 am

Re: Anti Recoil Script

Postby bonefisher » Wed Sep 25, 2019 4:18 am

No only for mouse!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: midg3t2 and 115 guests