Want this Aim Assist script triggers changed

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

Want this Aim Assist script triggers changed

Postby ObnoxiousBoxes » Mon Feb 12, 2024 3:15 pm

Hi guys, currently this aim assist script is activated by pressing either L2 or R2. Would like it to be deactivated if there's any right stick input above 5%.

That way it will be active when I'm pre-aiming and when I actually move my crosshair it won't mess with my aim at all (and the rotational AA will kick in cause I'm moving my crosshair manually!). Any help appreciated.

Code: Select all
main {
  if(is_release(STICK_1_X)^^is_release(STICK_1_Y)) Delay=10;
  else Delay=20;
 
  c_AS = (is_active(BUTTON_8) || is_active(BUTTON_5));
}
 
combo c_AS {
  set_val(STICK_1_Y, f_a_f(STICK_1_Y, AP));
  wait(Delay);
  set_val(STICK_1_X, f_a_f(STICK_1_X, AP));
  wait(Delay);
  set_val(STICK_1_Y, f_a_f(STICK_1_Y, AM));
  wait(Delay);
  set_val(STICK_1_X, f_a_f(STICK_1_X, AM));
  wait(Delay-1);
  set_val(STICK_1_X, f_a_f(STICK_1_X, AM));
}
 
fix32 f_a_f(uint8 p, fix32 m) { return  (abs(get_val(p)) < Release) ? m : get_val(p); }
 
main {
  if(sqrt(sq(get_actual(STICK_1_X))+sq(get_actual(STICK_1_Y)))>90f){
    set_val(STICK_1_X, get_actual(STICK_1_X));
    set_val(STICK_1_Y, get_actual(STICK_1_Y));
  }
}
User avatar
ObnoxiousBoxes
Sergeant
Sergeant
 
Posts: 7
Joined: Tue Nov 21, 2023 5:31 pm

Re: Want this Aim Assist script triggers changed

Postby Mad » Mon Feb 19, 2024 6:30 am

Change this line:
Code: Select all
if(sqrt(sq(get_actual(STICK_1_X))+sq(get_actual(STICK_1_Y)))>90f){

to:
Code: Select all
if(sqrt(sq(get_actual(STICK_1_X))+sq(get_actual(STICK_1_Y)))>5f){
Mad
Major General
Major General
 
Posts: 4538
Joined: Wed May 22, 2019 5:39 am

Re: Want this Aim Assist script triggers changed

Postby ObnoxiousBoxes » Wed Feb 28, 2024 12:08 pm

Sorry for the late reply, not been on all week!

Wow that simple, I'll try that later, thanks so much!
User avatar
ObnoxiousBoxes
Sergeant
Sergeant
 
Posts: 7
Joined: Tue Nov 21, 2023 5:31 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 55 guests