Set Value Range?

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

Set Value Range?

Postby Goatedgoose » Fri Oct 21, 2022 6:06 pm

Hey fam, how would I do this:

If Left Stick X value is within 100-15 (on device monitor) and (button) is pressed, set value Left Stick X to 85
User avatar
Goatedgoose
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Sat Sep 11, 2021 3:12 pm

Re: Set Value Range?

Postby Scachi » Sat Oct 22, 2022 7:47 am

If you want to create scripts you should read the gpc2 scripting section and the gpc2 language reference in the wiki
and experiment a bit.
https://www.consoletuner.com/wiki/index ... _scripting
https://www.consoletuner.com/wiki/index ... _reference

Some function overview: https://www.consoletuner.com/wiki/index ... :functions
More examples: https://www.consoletuner.com/wiki/index ... examples_1

Code: Select all
 
if (get_actual(STICK_2_X) > 15.0 && is_active(BUTTON_5)) set_val(STICK_2_X, 85.0);
 
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 119 guests