remap a short axis to a long axis.

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

remap a short axis to a long axis.

Postby halloll » Mon Dec 27, 2021 3:13 pm

I'm trying to remap the value of the twist axis on a VKB Gladiator flight stick seen by gtuner as BUTTON_8(L2) which goes from( 0 to +100), to the value of sitck_1_X which goes from (-100 to +100). using the input translator only maps the positive side of the axis and doesn't give me the full range.
I'm using get_actual() because the value of L2 is in use by another axis.

gtuner won't let me declare the original axis value in a variable which is why I have no Idea how to finish the script, any help is appreciated.

Code: Select all
 
//use twist as -100 to 100 of stick1 x, twist is 0 to 100 , stick is -100 to +100
    if((get_actual(BUTTON_8)) > 51.0 ) {
        set_val(STICK_1_X, get_actual(BUTTON_8));
 
    }
 
       if((get_actual(BUTTON_8)) < 49.0 ) {
 
    set_val(STICK_1_X, get_actual(BUTTON_8));
    }
 
User avatar
halloll
Private First Class
Private First Class
 
Posts: 2
Joined: Mon Dec 27, 2021 10:45 am

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 78 guests