Script Request - Controller
7 posts
• Page 1 of 1
Script Request - Controller
Hi,
May I request that someone with better gpc knowledge than me create for me a script with: Right Stick Sensitivity increased and Hair triggers. Any help is appreciated
May I request that someone with better gpc knowledge than me create for me a script with: Right Stick Sensitivity increased and Hair triggers. Any help is appreciated
-
Luchi - Sergeant
- Posts: 7
- Joined: Thu Mar 28, 2019 11:13 pm
Re: Script Request - Controller
Here is your script. You can adjust the right stick sensitivity in the define at the very beginning of the code. Higher this number, more sensitivity the stick will be. In the example below the sensitivity is being increased by 25%.
- Code: Select all
#define SENSITIVITY 1.25
main {
// Right Stick Sensitivity increased
set_val(STICK_1_X, get_val(STICK_1_X) * SENSITIVITY);
set_val(STICK_1_Y, get_val(STICK_1_Y) * SENSITIVITY);
// Hair triggers
if(get_val(BUTTON_5)) {
set_val(BUTTON_5, 100.0);
}
if(get_val(BUTTON_8)) {
set_val(BUTTON_8, 100.0);
}
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Script Request - Controller
Thank you!
Having tried the script it seems like the right stick is reversed for some reason, any ideas?
Having tried the script it seems like the right stick is reversed for some reason, any ideas?
-
Luchi - Sergeant
- Posts: 7
- Joined: Thu Mar 28, 2019 11:13 pm
Re: Script Request - Controller
The script shouldn't reverse the stick. Please let me know what is reversed? forward with backward? left with right? thanks.
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Script Request - Controller
J2Kbr wrote:The script shouldn't reverse the stick. Please let me know what is reversed? forward with backward? left with right? thanks.
It may reverse the stick when the result of "sensitivity value*get_val(STICK_1_Y)" reaches some limit and the value inverts or something like that...well..this happened with older versions of T2 firmware, a clamp() call was needed in those cases in some of my scripts to get rid of this issue... haven't used sensitivity modification much recently.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Script Request - Controller
You are absolutely correct. Added clam():
- Code: Select all
#define SENSITIVITY 1.25
main {
// Right Stick Sensitivity increased
set_val(STICK_1_X, clamp(get_val(STICK_1_X) * SENSITIVITY, -100.0, 100.0));
set_val(STICK_1_Y, clamp(get_val(STICK_1_Y) * SENSITIVITY, -100.0, 100.0));
// Hair triggers
if(get_val(BUTTON_5)) {
set_val(BUTTON_5, 100.0);
}
if(get_val(BUTTON_8)) {
set_val(BUTTON_8, 100.0);
}
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Script Request - Controller
Looks good! Thank you
-
Luchi - Sergeant
- Posts: 7
- Joined: Thu Mar 28, 2019 11:13 pm
7 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: trezor and 97 guests