Page 1 of 2

Gurus HELP with a SIMPLE anti recoil script

PostPosted: Sat Jul 14, 2018 9:31 am
by TheSaint
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.

Re: Gurus HELP with a SIMPLE anti recoil script

PostPosted: Sat Jul 14, 2018 11:38 am
by Scachi
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));
        }
    }
}
 

Re: Gurus HELP with a SIMPLE anti recoil script

PostPosted: Sat Jul 14, 2018 1:47 pm
by TheSaint
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?

Re: Gurus HELP with a SIMPLE anti recoil script

PostPosted: Sat Jul 14, 2018 2:02 pm
by Scachi
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 1604 times

Re: Gurus HELP with a SIMPLE anti recoil script

PostPosted: Tue Jul 17, 2018 1:02 am
by mpalpha
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

Re: Gurus HELP with a SIMPLE anti recoil script

PostPosted: Tue Jul 17, 2018 9:23 pm
by TheSaint
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

Re: Gurus HELP with a SIMPLE anti recoil script

PostPosted: Wed Jul 18, 2018 1:47 am
by bonefisher
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!

Re: Gurus HELP with a SIMPLE anti recoil script

PostPosted: Wed Jul 18, 2018 11:55 am
by TheSaint
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?

Re: Gurus HELP with a SIMPLE anti recoil script

PostPosted: Wed Jul 18, 2018 12:30 pm
by Scachi
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 ?

Re: Gurus HELP with a SIMPLE anti recoil script

PostPosted: Wed Jul 18, 2018 4:46 pm
by TheSaint
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 ..