Help with this script please

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

Help with this script please

Postby Beryl » Thu Apr 20, 2023 8:07 am

Can someone add a command into this so itl only activate on LT activation?
So when i press the LT i can use the action below? Iv figured out how to edit it but just need to only activate on LT press


main { if (get_actual(STICK_2_Y) == -100.0) set_val(BUTTON_9,100); }
User avatar
Beryl
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 198
Joined: Fri Nov 27, 2020 7:47 pm

Re: Help with this script please

Postby Scachi » Thu Apr 20, 2023 8:16 am

not sure if this is what you are asking for:
Code: Select all
main { if (get_actual(STICK_2_Y) == -100.0 && event_active(BUTTON_8)) set_val(BUTTON_9,100); }

potential issue with this is the button_9 press not being registered by the game as it may be pressed for a time too short.
to fix this use a combo for the BUTTON_9 press instead of the set_val directly
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Help with this script please

Postby Beryl » Thu Apr 20, 2023 8:25 am

Thanks for your help! What id been using it for was to use the left analog down press to crouch as i figured out how to change the inputs just adding the event was beyond me ha!
This will hopefully give me the option to spam crouch when i ads! Thanks for your help
User avatar
Beryl
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 198
Joined: Fri Nov 27, 2020 7:47 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 197 guests