Gurus HELP with a SIMPLE anti recoil script

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

Gurus HELP with a SIMPLE anti recoil script

Postby TheSaint » Sat Jul 14, 2018 9:31 am

I am new to titan 2 I need help from Gurus please.
I play mostly rainbow six and I have been trying few scripts but all seem to have same issue, after firing during ADS, the weapon points down and aim is worse off with script that without.I am assume I am doing something wrong and help clarifying how to get it working is much appreciated!

I just need a simple anti recoil script that is easy to implment.
User avatar
TheSaint
Command Sergeant Major
Command Sergeant Major
 
Posts: 148
Joined: Sun Jun 24, 2018 1:43 pm

Re: Gurus HELP with a SIMPLE anti recoil script

Postby Scachi » Sat Jul 14, 2018 11:38 am

Implement ? Are you already having a script and you are trying to add anti recoil to it ?
If this is the case maybe you are doing something wrong when you add the code to your code and it is not the cause of the anti recoil script/function itself ? - Post your script here to get some help.

This code works fine.
You can change the anti recoil values via the Interactive Configuration for HIP and ADS and hit the "SAVE and Run" button.
Do not change the values in the code !
Code: Select all
 
/*** interactive configuration ***
 
<cfgdesc>
 
[Sticknoise]
shortdesc    = <<<MULTILINE
The default value 4.32 should be a good start.
If you want to tweak this, set it to the max value of your sticks resting position values.
Use the "Device Monitor" to examine them.
MULTILINE
byteoffset= 0
bitsize   = 32
control   = spinboxf
default   = 432
minimum   = 0
maximum   = 2000
step      = 1
decimals  = 2
 
[Anti Recoil - HIP - Vertical]
shortdesc    = Vertical recoil compensation
byteoffset= 4
bitsize   = 32
control   = spinboxf
default   = 100
minimum   = -1000
step      = 1
maximum   = 1000
decimals  = 1
 
[Anti Recoil - HIP - Horizontal]
shortdesc = Horizontal recoil compensation
byteoffset= 8
bitsize   = 32
control   = spinboxf
default   = 0
minimum   = -1000
maximum   = 1000
step      = 1
decimals  = 1
 
[Anti Recoil - ADS - Vertical]
shortdesc = Vertical recoil compensation
byteoffset= 12
bitsize   = 32
control   = spinboxf
default   = 050
minimum   = -1000
maximum   = 1000
step      = 1
decimals  = 1
 
[Anti Recoil - ADS - Horizontal]
shortdesc = Horizontal recoil compensation
byteoffset= 16
bitsize   = 32
control   = spinboxf
default   = 0
minimum   = -1000
maximum   = 1000
step      = 1
decimals  = 1
 
</cfgdesc>
 
*/

 
// Use the Interactive Configuration, do not change the values here in this code !
fix32 RECOIL_V = 10.0;
fix32 RECOIL_H = 0.0;
fix32 RECOIL_V_ADS = 5.0;
fix32 RECOIL_H_ADS = 0.0;
 
fix32 RY;
fix32 RX;
 
fix32 StickNoise = 4.32;
 
init {
  pmem_load();
  pmem_read(0,&StickNoise);
  pmem_read(4,&RECOIL_V);       // HIP
  pmem_read(8,&RECOIL_H);       // HIP
  pmem_read(12,&RECOIL_V_ADS)// ADS
  pmem_read(16,&RECOIL_H_ADS)// ADS
}
 
main {
 
 
// DEADZONE REMOVER
    if(abs(get_actual(STICK_1_X)) < StickNoise) { set_val(STICK_1_X, 0.0); }
    if(abs(get_actual(STICK_1_Y)) < StickNoise) { set_val(STICK_1_Y, 0.0); }
    if(abs(get_actual(STICK_2_X)) < StickNoise) { set_val(STICK_2_X, 0.0); }
    if(abs(get_actual(STICK_2_Y)) < StickNoise) { set_val(STICK_2_Y, 0.0); }
 
// ANTI-RECOIL
    if (get_val(BUTTON_5))
    {
        // HIP
        if (!get_val(BUTTON_8)) {
          AntiRecoil(STICK_1_Y,RECOIL_V);
          AntiRecoil(STICK_1_X,RECOIL_H);
        }
        // ADS
        else if (get_val(BUTTON_8)) {
          AntiRecoil(STICK_1_Y,RECOIL_V_ADS);
          AntiRecoil(STICK_1_X,RECOIL_H_ADS);
        }
    }
}
 
void AntiRecoil (uint8 axis, fix32 recoil)
{
 
     RY = get_actual(STICK_1_Y);
     RX = get_actual(STICK_1_X);
 
    if (get_val(BUTTON_5) && (sqrt(RX*RX + RY*RY)) <= abs(recoil))
    {
        if(abs(RY) <= abs(recoil))
        {
            set_val(axis,(recoil * (100.0 - abs(get_val(axis)))) / 100.0 + get_val(axis));
        }
    }
}
 
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Gurus HELP with a SIMPLE anti recoil script

Postby TheSaint » Sat Jul 14, 2018 1:47 pm

Thank you Scachi for your help.
I have tested antithesis anti recoil v1.02 and v1.01 scripts with both giving similar results, in ADS, the weapon will point sharply down as soon as I start firing. The scripts were dragged to T2 without any changes. When I said implement, I meant is there anything else I need to do to get script to work? Make changes in XimApp configurations/settings for example?
User avatar
TheSaint
Command Sergeant Major
Command Sergeant Major
 
Posts: 148
Joined: Sun Jun 24, 2018 1:43 pm

Re: Gurus HELP with a SIMPLE anti recoil script

Postby Scachi » Sat Jul 14, 2018 2:02 pm

I don't know about xim, i have none.
With the script posted above, the default settings for anti recoil are very low and are adjustable via interactive configuration, test low values like 2, 5 or 10
It has different settings for ads and hip fire.
So firing while ADS should not point straight to the ground with this.

Make sure you hit the "Save and Run" button after adjusting values. Hitting OK only will not apply the changes to the running script !
ic-antirecoil.jpg
ic-antirecoil.jpg (72.42 KiB) Viewed 1598 times
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Gurus HELP with a SIMPLE anti recoil script

Postby mpalpha » Tue Jul 17, 2018 1:02 am

TheSaint wrote:Thank you Scachi for your help.
I have tested antithesis anti recoil v1.02 and v1.01 scripts with both giving similar results, in ADS, the weapon will point sharply down as soon as I start firing. The scripts were dragged to T2 without any changes. When I said implement, I meant is there anything else I need to do to get script to work? Make changes in XimApp configurations/settings for example?


try mine https://www.consoletuner.com/forum/viewtopic.php?f=20&t=6917&p=67401#p67401
User avatar
mpalpha
Staff Sergeant
Staff Sergeant
 
Posts: 11
Joined: Mon Jun 11, 2018 11:02 pm

Re: Gurus HELP with a SIMPLE anti recoil script

Postby TheSaint » Tue Jul 17, 2018 9:23 pm

Thank you mpalpha, I have tried your script, unfortunately I am having same with all anti recoil scripts including yours where weapon points to ground while in ADS and recoil is all over the place regardless of values or weapon.

I have recorded issue on YT. If you know of any possible resolution I would be grrrrrreatly appreciative!

https://www.youtube.com/watch?v=rWaN4gs ... e=youtu.be
User avatar
TheSaint
Command Sergeant Major
Command Sergeant Major
 
Posts: 148
Joined: Sun Jun 24, 2018 1:43 pm

Re: Gurus HELP with a SIMPLE anti recoil script

Postby bonefisher » Wed Jul 18, 2018 1:47 am

Mine don't do that.... looks like you have something wrong there like swap triggers because we don't usually put anti-recoil just on the ADS without it firing. You might want to check for update for the T2 also!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Gurus HELP with a SIMPLE anti recoil script

Postby TheSaint » Wed Jul 18, 2018 11:55 am

T2 patched up to date so us Xim apex.. Is there anything else that cold cause this odd behaviour? XimAp works perfectly on its own.
Are there any game settings that need changed maybe?
User avatar
TheSaint
Command Sergeant Major
Command Sergeant Major
 
Posts: 148
Joined: Sun Jun 24, 2018 1:43 pm

Re: Gurus HELP with a SIMPLE anti recoil script

Postby Scachi » Wed Jul 18, 2018 12:30 pm

TheSaint wrote:Thank you mpalpha, I have tried your script, unfortunately I am having same with all anti recoil scripts including yours where weapon points to ground while in ADS and recoil is all over the place regardless of values or weapon.

I have recorded issue on YT. If you know of any possible resolution I would be grrrrrreatly appreciative!

https://www.youtube.com/watch?v=rWaN4gs ... e=youtu.be

Are you playing with the default button layout or do you use another controller layout setting ?
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Gurus HELP with a SIMPLE anti recoil script

Postby TheSaint » Wed Jul 18, 2018 4:46 pm

I am using default controller layout. I have noticed today as I adjusted values right/left stick, there was some change to firing issue, not as drastuc drop down, but targeting becomes shaky and it harder to place scope on target. I wonder if that means anything ..
User avatar
TheSaint
Command Sergeant Major
Command Sergeant Major
 
Posts: 148
Joined: Sun Jun 24, 2018 1:43 pm

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 106 guests