Analog Stick Toggle w/ button press
9 posts
• Page 1 of 1
Analog Stick Toggle w/ button press
Hey guys,
I've just build an analog arcade stick and its working great with the Titan Two.
But I'm looking to add some functionality by having one of my buttons toggle the stick being used.
Example:
The Button is Button_15.
I want to hit and hold Button_15 and have that change my stick from the left stick to the right stick while I'm holding that button. Once Button_15 is released its back to being the left stick.
Any help would be super appreciated!
I've just build an analog arcade stick and its working great with the Titan Two.
But I'm looking to add some functionality by having one of my buttons toggle the stick being used.
Example:
The Button is Button_15.
I want to hit and hold Button_15 and have that change my stick from the left stick to the right stick while I'm holding that button. Once Button_15 is released its back to being the left stick.
Any help would be super appreciated!
-
Migs - Corporal
- Posts: 4
- Joined: Sun Jun 09, 2019 2:45 am
Re: Analog Stick Toggle w/ button press
Give this a go
- Code: Select all
main {
if(event_active(BUTTON_15)) {
remapper_swap(STICK_1_X, STICK_2_X);
remapper_swap(STICK_1_Y, STICK_2_Y);
}
else if(event_release(BUTTON_15)) { remapper_reset(); }
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
- Mad
- Major General
- Posts: 4533
- Joined: Wed May 22, 2019 5:39 am
Re: Analog Stick Toggle w/ button press
Thank you Mad for helping here. Appreciated.
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Analog Stick Toggle w/ button press
You're welcome. Thanks for the new role
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
- Mad
- Major General
- Posts: 4533
- Joined: Wed May 22, 2019 5:39 am
Re: Analog Stick Toggle w/ button press
Thanks so much for your help on this Mad, the script works great!
The one problem I'm encountering is having it work with my input translator settings. If I load the GPC Script by itself into a memory slot it works, but stacking it in another memory slot with my input translator settings it wont work.
Thanks again for your help, I appreciate your time.
The one problem I'm encountering is having it work with my input translator settings. If I load the GPC Script by itself into a memory slot it works, but stacking it in another memory slot with my input translator settings it wont work.
Thanks again for your help, I appreciate your time.
-
Migs - Corporal
- Posts: 4
- Joined: Sun Jun 09, 2019 2:45 am
Re: Analog Stick Toggle w/ button press
Try this:
- Code: Select all
main {
if(get_actual(BUTTON_15)) {
set_val(STICK_1_X,get_actual(STICK_2_X));
set_val(STICK_1_Y,get_actual(STICK_2_Y));
set_val(STICK_2_X,get_actual(STICK_1_X));
set_val(STICK_2_Y,get_actual(STICK_1_Y));
}
}
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Analog Stick Toggle w/ button press
Thanks Scachi, unfortunately this doesn't seem to work.
The new mapping with Input Translator for the button is Button_21.
Thanks for all the help on this guys!
The new mapping with Input Translator for the button is Button_21.
Thanks for all the help on this guys!
-
Migs - Corporal
- Posts: 4
- Joined: Sun Jun 09, 2019 2:45 am
Re: Analog Stick Toggle w/ button press
Normal buttons:
BUTTON_15 PS4:"Circle", XB:"B"
BUTTON_16 PS4:"Cross", XB:"A"
When you have a mapping done via the input translator it will still work.
Example, Input Translator that maps : BUTTON_15 <-> BUTTON_16
Having this Input Translator active...
you press PS4:CROSS button, but the Titan Two will now read it as button PS4:CIRCLE
result: you now have to hold button CROSS to have the sticks swapping active.
If you need this on a different button number change BUTTON_15 in the code I have posted to your button you want to use stick swap for.
Hit F1 in GTuner IV and take a look at the GPC Input Reference.
BUTTON_15 PS4:"Circle", XB:"B"
BUTTON_16 PS4:"Cross", XB:"A"
When you have a mapping done via the input translator it will still work.
Example, Input Translator that maps : BUTTON_15 <-> BUTTON_16
Having this Input Translator active...
you press PS4:CROSS button, but the Titan Two will now read it as button PS4:CIRCLE
result: you now have to hold button CROSS to have the sticks swapping active.
If you need this on a different button number change BUTTON_15 in the code I have posted to your button you want to use stick swap for.
Hit F1 in GTuner IV and take a look at the GPC Input Reference.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Analog Stick Toggle w/ button press
i rewrote your scripts like this:
and it's working!
Thanks for all the help on this from all you guys.
This project has come together quite nicely.
- Code: Select all
main {
if(get_actual(BUTTON_21)) {
set_val(STICK_1_X,get_actual(STICK_2_X));
set_val(STICK_1_Y,get_actual(STICK_2_Y));
set_val(STICK_2_X,get_actual(STICK_1_X));
set_val(STICK_2_Y,get_actual(STICK_1_Y));
}
}
and it's working!
Thanks for all the help on this from all you guys.
This project has come together quite nicely.
-
Migs - Corporal
- Posts: 4
- Joined: Sun Jun 09, 2019 2:45 am
9 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 107 guests