Guys, would you help me test my new anti-recoil script?

Documentation, usage tips and configuration guides for Titan Two scripts and bytecodes published by the community users.

Re: Guys, would you help me test my new anti-recoil script?

Postby Mad » Sun Jul 28, 2019 10:46 am

Make sure to credit DrNefario for his work.

Code: Select all
#define sn 13.0 // Change deadzone value
#define ar 12.0 // Change anti-recoil value
 
#define RY get_actual(22)
#define RX get_actual(21)
 
main {
  if (get_actual(4)) AntiRecoil(ar);
}
 
void AntiRecoil (fix32 recoil) {
  fix32 modifiedRY;
 
  fix32 trueRY = (sqrt(RY*RY+RX*RX)-sn)/sqrt(RY*RY+RX*RX)*RY;
  fix32 trueRX = (sqrt(RY*RY+RX*RX)-sn)/sqrt(RY*RY+RX*RX)*RX;
 
  if (RY > 0.0) modifiedRY = (100.0-sn-recoil)/(100.0-sn)*trueRY + recoil;
  if (RY < 0.0) modifiedRY = (100.0-sn+recoil)/(100.0-sn)*trueRY + recoil;
 
  fix32 altradius = sqrt(trueRX*trueRX + modifiedRY*modifiedRY);
 
  fix32 finalRX = trueRX * (altradius + sn)/altradius;
  fix32 finalRY = modifiedRY * (altradius + sn)/altradius;
 
  if (RX*RX+RY*RY <= sn*sn) set_val(22,(sn+recoil));
 
  if (RX*RX+RY*RY > sn*sn) {
    set_val(22,clamp(finalRY, -100f, 100f));
    set_val(21,clamp(finalRX, -100f, 100f));
  }
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am

Re: Guys, would you help me test my new anti-recoil script?

Postby Mr.robot » Sun Jul 28, 2019 10:58 am

It's for my own use :)
Big thx to all of you & specially DrNefario ,Mad & bonefisher
:joia:
User avatar
Mr.robot
Sergeant
Sergeant
 
Posts: 8
Joined: Sun Jul 28, 2019 10:17 am

Re: Guys, would you help me test my new anti-recoil script?

Postby residualflash » Tue Jul 30, 2019 5:11 pm

Got a question for you guys. On all the Xim related recoil scripts, I see there is stick noise removed. However, when I go to device monitor, I see both sticks at 0.0. I tried moving it around but it still rests at 0.0. does my xim not add any stick noise? I have SAB set to off instead of 0 if it makes a difference.
User avatar
residualflash
Master Sergeant
Master Sergeant
 
Posts: 39
Joined: Fri Apr 05, 2019 8:37 pm

Re: Guys, would you help me test my new anti-recoil script?

Postby Mad » Tue Jul 30, 2019 7:29 pm

The xim will only add stick noise is SAB is enabled.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am

Re: Guys, would you help me test my new anti-recoil script?

Postby DrNefario » Tue Jul 30, 2019 11:21 pm

Guys, i just updated my script.

I make few changes to the algorithm, it will eat up your cpu usage a little bit more(about 2% more), but i guarantee this will be the best anti_recoil algorithm yet.

VERY important, since the deadzone will highly effect the accuracy of this algorithm, you must refer to your in-game settings in order to achieve best performance. If you are a xim user, you must make sure your xim profile is matching the in-game setting.

Since this script is made for Battlefield, I personally tuned a little bit specially for that. Currently this script is best for BFV, other games might have a little bit performance issue. I guarantee for BFV users, if you make your settings right, you won't even notice there is recoil(well, that is a little bit over exaggerate). Highly recommend using semi-auto rifles, like m1a1.
User avatar
DrNefario
Master Sergeant
Master Sergeant
 
Posts: 35
Joined: Sun Dec 30, 2018 12:04 pm

Re: Guys, would you help me test my new anti-recoil script?

Postby DrNefario » Tue Jul 30, 2019 11:28 pm

J2Kbr wrote:Thank you for publishing your script. I will be testing, possible during the weekend. ;)



Hi, J2Kbr, mind if I ask for a comment? I really appreciate your help, thanks.
User avatar
DrNefario
Master Sergeant
Master Sergeant
 
Posts: 35
Joined: Sun Dec 30, 2018 12:04 pm

Re: Guys, would you help me test my new anti-recoil script?

Postby jelly44 » Wed Jul 31, 2019 7:19 am

DrNefario wrote: I guarantee for BFV users, if you make your settings right, you won't even notice there is recoil(well, that is a little bit over exaggerate). Highly recommend using semi-auto rifles, like m1a1.


Next time I get gunned down by someone across the map I'll know who that is :D

Have you check it with tommy and suomi These weapons have by far the highest recoil in the game.

I'll hopefully test your script during the weekend.
- My recommendation for learning C programming: 'C Programming Absolute Beginner's Guide'
- Create your own scripts with GPC2 Scripting
User avatar
jelly44
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 220
Joined: Tue Feb 05, 2019 3:49 pm

Re: Guys, would you help me test my new anti-recoil script?

Postby DrNefario » Wed Jul 31, 2019 9:28 am

jelly44 wrote:
Have you check it with tommy and suomi These weapons have by far the highest recoil in the game.



They have too much horizontal spread, there indeed a way to compensate that, but i won't bother, cause that will cost too much effort.
User avatar
DrNefario
Master Sergeant
Master Sergeant
 
Posts: 35
Joined: Sun Dec 30, 2018 12:04 pm

Re: Guys, would you help me test my new anti-recoil script?

Postby Tahsin » Thu Aug 01, 2019 10:23 pm

I like your script can you creat one script like this for Pubg it works great but r3 dosent work
User avatar
Tahsin
Sergeant Major
Sergeant Major
 
Posts: 100
Joined: Wed May 15, 2019 7:57 am

Re: Guys, would you help me test my new anti-recoil script?

Postby jelly44 » Tue Aug 06, 2019 7:44 am

DrNefario wrote:
jelly44 wrote:
Have you check it with tommy and suomi These weapons have by far the highest recoil in the game.



They have too much horizontal spread, there indeed a way to compensate that, but i won't bother, cause that will cost too much effort.


Understood, it makes sense.

Any plans to include easy slide, quick melee, hold breath, strafe... etc?

Cheers and thanks for the great algorithm.
- My recommendation for learning C programming: 'C Programming Absolute Beginner's Guide'
- Create your own scripts with GPC2 Scripting
User avatar
jelly44
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 220
Joined: Tue Feb 05, 2019 3:49 pm

PreviousNext

Return to User's Script Documentation

Who is online

Users browsing this forum: No registered users and 91 guests