help

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

help

Postby Cokey » Thu Jul 16, 2020 12:35 am

i need one that does vertical and horizontal and has minimum recoil and maximum recoil please.

I am using guns that has very unpredictable recoil most of the time.

I will pay if i have too, its for bfv.

I tried using universal game pack, but first few shots recoil is good, but it seems to make my recoil very unpredictable, compared to when using j2k bfv game pack, just that his script (j2k bfv) doesn't acccept values of -0.20 it makes no difference when it should on the horizontal recoil.

On the universal game pack i have deadzone compensation to 13.0 as what it is in game on the right analog stick.
I put stick drift on 4.0.

x recoil is on -10.7 which helps the horizontal recoil.

y recoil is on 2.9, first 2 seconds shots are good, but after that it goes down really fast, which makes no sence, as 2.9 seems to be the best value for handling my recoil for the first few shots.
Last edited by Cokey on Thu Jul 16, 2020 4:22 am, edited 1 time in total.
User avatar
Cokey
Command Sergeant Major
Command Sergeant Major
 
Posts: 112
Joined: Sun Nov 11, 2018 5:04 pm

Re: need script for xim apex titan two

Postby Mad » Thu Jul 16, 2020 2:13 am

Try this and see if its any better. It's an anti-recoil by Dont@Me to prevent stacking on xim. It's in testing stages so feedback is appreciated.
Dont@Me wrote:this anti recoil script meant to work with the xim,

Different games use different size deadzones, the xim compensates for this and skips the deadzone when you move your mouse. this results in stacked values, (too much anti recoil)

so adjust the dz value accordingly. all games are different.

cod mw for example you would use a dz value of 7.0 for ps4, and 9.0 for xbox.

Code: Select all
//Dont@Me
fix32 vr = 25.0; // vertical recoil
fix32 hr = 0.0; // horizontal recoil
#define dz 10.0 // xims deadzone size
 
main {
 
  if(is_active(4)){
 
    offset(21, hr);
    offset(22, vr);
 
    if(sqrt(sq(get_actual(21)) + sq(get_actual(22))) > (fix32)dz)
    if(get_actual(22) > 0.0) compensate(get_val(21), get_val(22));
    else {
      set_val(21, get_actual(21));
      set_val(22, get_actual(22));
    }
  }
}
 
void offset(uint8 axis, fix32 offset_val) {
  set_val(axis, clamp(offset_val * (100f - abs(get_actual(axis))) / 100f + get_actual(axis), -100f, 100f));
  return;
}
void compensate(fix32 xv, fix32 yv){
  #define BR 0.785385
  #define TL 3.927002
  #define TAU (PI * 2.0)
  fix32 a = mod(atan2(yv, xv) + TAU, TAU);
  fix32 X = cos(a);
  fix32 Y = sin(a);
  fix32 m = sqrt(sq(get_actual(21)) + sq(get_actual(22))) - (fix32)dz;
  if(a <= TL & a >= BR){
    X = -sin(a - 1.570801);
    Y = -cos(a - 4.713135);
  }
  set_val(21, X * m+hr);
  set_val(22, Y * m+vr);
}
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: help

Postby Cokey » Thu Jul 16, 2020 4:33 am

I tested it, and when i hold fire down, i counted about 5 seconds untill it performed the anti recoil action.

if i keep playing around with the vertical values, then i notice it does do the anti recoil action on time, but no value will make it just shoot straight, it keeps jumping up and down like crazy.

13.0 is too slow, 14.00 is way to fast.

13.80 makes no difference.

thats like the issue im stuck with with this script.
User avatar
Cokey
Command Sergeant Major
Command Sergeant Major
 
Posts: 112
Joined: Sun Nov 11, 2018 5:04 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 145 guests

cron