"Sticky" radial menu script
6 posts
• Page 1 of 1
"Sticky" radial menu script
Hi all, I'm pretty sure I've seen this posted before but I can't seem to find it.
Some games require you to hold the analogue stick in a certain direction before letting go of the menu button. I would like to make it so a quick flick of the stick is all I need to do.
Here's my attempt at it but it doesn't work:
Some games require you to hold the analogue stick in a certain direction before letting go of the menu button. I would like to make it so a quick flick of the stick is all I need to do.
Here's my attempt at it but it doesn't work:
- Code: Select all
if(get_val(ZR)) {
radial_menu_selection_y = (int) get_val(RS_Y);
radial_menu_selection_x = (int) get_val(RS_X);
}
set_val(RS_Y, radial_menu_selection_y);
set_val(RS_X, radial_menu_selection_x);
if(event_release(ZR)) {
radial_menu_selection_y = 0;
radial_menu_selection_x = 0;
}
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: "Sticky" radial menu script
welcome back ;-)
give this a try:
give this a try:
- Code: Select all
int radial_menu_selection_y, radial_menu_selection_x;
#define ZR BUTTON_9
#define RS_X STICK_1_X
#define RS_Y STICK_1_Y
#define S_MIN 80
main {
if(get_val(ZR)) {
if (abs(get_val(RS_Y)) > (fix32)S_MIN || abs(get_val(RS_X)) > (fix32)S_MIN) {
radial_menu_selection_y = (int) get_val(RS_Y);
radial_menu_selection_x = (int) get_val(RS_X);
}
}
set_val(RS_Y, radial_menu_selection_y);
set_val(RS_X, radial_menu_selection_x);
if(event_release(ZR)) {
radial_menu_selection_y = 0;
radial_menu_selection_x = 0;
}
}
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: "Sticky" radial menu script
Great to be back! It works great in the menu but after that the stick becomes completely unresponsive. In Device Monitor it seems nothing is making its way through.
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: "Sticky" radial menu script
Sounds like you want that active only as long as you hold down that ZR button:
- Code: Select all
int radial_menu_selection_y, radial_menu_selection_x;
#define ZR BUTTON_9
#define RS_X STICK_1_X
#define RS_Y STICK_1_Y
#define S_MIN 80
main {
if(get_val(ZR)) {
if (abs(get_val(RS_Y)) > (fix32)S_MIN || abs(get_val(RS_X)) > (fix32)S_MIN) {
radial_menu_selection_y = (int) get_val(RS_Y);
radial_menu_selection_x = (int) get_val(RS_X);
}
set_val(RS_Y, radial_menu_selection_y);
set_val(RS_X, radial_menu_selection_x);
}
if(event_release(ZR)) {
radial_menu_selection_y = 0;
radial_menu_selection_x = 0;
}
}
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: "Sticky" radial menu script
That's it thank you!
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: "Sticky" radial menu script
Is it possible to make it so it's only sticky if you hold the stick at the edge for half a second, otherwise it "dislodges" and goes back to normal? I tried adding using time_active() but I couldn't get it working.
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
6 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: midg3t2 and 212 guests