hi guys, i have a quesion

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

hi guys, i have a quesion

Postby mikayuki » Sat Dec 15, 2018 2:03 am

The Input Translator only allows you to map a button to the entire X or Y axis. I want to map the buttons to the corresponding direction.

E.g. Square on PS4 = left on the right stick

This is what I've done...it works, but it's a bit of a hack. Surely there is a better way?

Code: Select all
main {
        if(get_val(GUARDBREAK)) {
            inhibit(GUARDBREAK, 300);
            combo_run(RightStickLeft);
        }
 
        if(get_val(MOV_RX_AXIS) < -50.00) {
            inhibit(MOV_RX_AXIS, 300);
            combo_run(GuardbreakForce);
        }
}
 
combo RightStickLeft {
    set_val(MOV_RX_AXIS, -100);
    wait(100);
}
 
combo GuardbreakForce {
    set_val(GUARDBREAK, 100);
    wait(40);
}
User avatar
mikayuki
Private First Class
Private First Class
 
Posts: 2
Joined: Sat Dec 15, 2018 1:54 am

Re: hi guys, i have a quesion

Postby J2Kbr » Sat Dec 15, 2018 6:22 am

Welcome to our forums.

For this remapping there is no need for combos, example:

Code: Select all
#define GUARDBREAK      BUTTON_17
#define MOV_RX_AXIS     STICK_2_X
 
main {
    if(get_actual(GUARDBREAK)) {
        set_val(GUARDBREAK, 0.0);
        set_val(MOV_RX_AXIS, -100.0);
    }
    if(get_actual(MOV_RX_AXIS) < -50.00) {
        set_val(MOV_RX_AXIS, 0.0);
        set_val(GUARDBREAK, 100.0);
    }
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 97 guests