Remap: Stick Y axis to L2/R2 (for Racing games)

A remix of my Sixaxis remapper script, this maps either stick's Y axis (up or down) to the accelerator and brake of your favorite racing game controls (aka L2 and R2). Use Select + Start to enable/disable, Select + L3/R3 to switch stick to remap.
Version1.00
AuthorCypherNova139
Publish DateSat, 14 Jun 2014 - 20:37
Last UpdateSat, 14 Jun 2014 - 20:37
Downloads66
RATE


0

0

Release Notes: Made for forum poster... The question got me curious so had to make this up.
Code: Select all
//This remaps the Left stick Y axis (up or down) to throttle and brake (R2 and L2) in any racing game.
 
//Press Select + Start to enable/disable the script, in case the game is at a point where both sticks are expected as normal.
//Press Select + L3/R3 to switch which stick to remap.
 
int StickY, StickX, enable;
 
init {
    StickY = PS3_LY;
    StickX = PS3_LX;
    enable = 1
    set_val(TRACE_1, 2);
}
 
 
main {
 
//Selection
if(get_val(PS3_SELECT) == 100) {
    block(PS3_SELECT, 500);
    if(event_press(PS3_START)) {
        if(enable == 1) {
            enable = 0;
            set_val(TRACE_1, 0);
        } else {
            enable = 1;
            set_val(TRACE_1, 1);
        }
    }
//  Use left stick
    if(event_press(PS3_L3)) {
        StickY = PS3_LY
        StickX = PS3_LX
    }
//  Use right stick
    if(event_press(PS3_R3)) {
        StickY = PS3_RY
        StickX = PS3_RX
    }
    set_val(PS3_START, 0);
    set_val(PS3_L3, 0);
    set_val(PS3_R3, 0);
}
 
 
 
//LY (left stick up/down)
if(enable == 1) {
    if(get_val(StickY) > 20) {
        //down
        set_val(PS3_L2, get_val(StickY));
        set_val(PS3_R2, 0);
    } else if(get_val(StickY) < -20) {
        set_val(PS3_R2, get_val(StickY) * -1);
        set_val(PS3_L2, 0);
    }
}
}