right analog stick
4 posts
• Page 1 of 1
right analog stick
hello is there a way to map my right analog stick to work like a dpad , the new 2k21 has a new shooting method where if you pull the right analog stick exactly straight down with no sway it will automatically score a basket. i didnt know if i could map the down on right dpad to be down on the right analog stick. thank you for your time
is there a way to put this script to my dpad down?
main {
set_val(STICK_1_X,0);
}
is there a way to put this script to my dpad down?
main {
set_val(STICK_1_X,0);
}
-
cullenmac - Sergeant First Class
- Posts: 18
- Joined: Sat Mar 24, 2018 3:41 am
Re: right analog stick
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
- Mad
- Major General
- Posts: 4532
- Joined: Wed May 22, 2019 5:39 am
Re: right analog stick
i tried the dpad it didnt work.
main {
set_val(STICK_1_X,-20);
} for anyone who plays 2k21 if you use the shot stick this is perfect but ild like to translate it it to dpad down so i can use the right analog stick to do dribble moves.
i tried the code it was off , is there a way to put this code
to one of my dpads
main {
set_val(STICK_1_X,-20);
} that works with most of my players with a high shot rating and i use this for lower rated shooters
main {
set_val(STICK_1_X,-18);
}
main {
set_val(STICK_1_X,-20);
} for anyone who plays 2k21 if you use the shot stick this is perfect but ild like to translate it it to dpad down so i can use the right analog stick to do dribble moves.
i tried the code it was off , is there a way to put this code
to one of my dpads
main {
set_val(STICK_1_X,-20);
} that works with most of my players with a high shot rating and i use this for lower rated shooters
main {
set_val(STICK_1_X,-18);
}
-
cullenmac - Sergeant First Class
- Posts: 18
- Joined: Sat Mar 24, 2018 3:41 am
Re: right analog stick
Right stick to 8-way directional d-pad.
Change STEADY_AIM value to 90.0 if you would like 4-way directional d-pad.
- Code: Select all
#pragma METAINFO("steady_aim", 1, 0, "DontAtMe")
fix32 _COS_(fix32 a) { /*^ cos fix */
a = mod(a + 6.28319, 6.28319);
if (a < 0.0) a = mod(a += 6.28319, 6.28319);
if (a > 0.785522 && a < 3.92761) return sin(1.5708 - a);
return cos(a);
}
fix32 _SIN_(fix32 a) { /*^ sin fix */
a = mod(a + 6.28319, 6.28319);
if (a < 0.0) a = mod(a += 6.28319, 6.28319);
if (a > 0.785522 && a < 3.92761) return cos(1.5708 - a);
return sin(a);
}
#define sin _SIN_
#define cos _COS_
#define STEADY_AIM 45.0
main {
fix32 a = deg2rad(lerp(0.0,360.0,(round(((rad2deg(mod(atan2(get_actual(STICK_1_Y),get_actual(STICK_1_X))+6.28319,6.28319))*(360.0/(fix32)STEADY_AIM))/360.0)))/(360.0/(fix32)STEADY_AIM)));
fix32 m = sqrt(sq(get_actual(STICK_1_X))+sq(get_actual(STICK_1_Y)));
set_val(STICK_1_X,clamp(cos(a)*m,-100.0,100.0));
set_val(STICK_1_Y,clamp(sin(a)*m,-100.0,100.0));
}
Change STEADY_AIM value to 90.0 if you would like 4-way directional d-pad.
-
DontAtMe - Captain
- Posts: 502
- Joined: Tue Oct 02, 2018 4:49 am
4 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 86 guests