SixAxis remapper - Reverse (Steer with sixaxis)

This reverse version of my SixAxis remapper script remaps the Sixaxis to one of the sticks. Useful for racing games if you like steering by tilting the controller. To use the script: By default the sixaxis remaps to the left stick. Use Select + L3/R3 to switch which stick to remap to, or press Select + Start to enable/disable the remap.
Version1.5
AuthorCypherNova139
Publish DateSat, 17 May 2014 - 15:04
Last UpdateFri, 20 Jun 2014 - 02:19
Downloads79
RATE


1

0

Release Notes: Reworked customizing functionality, so now Select is only sent when it is pressed.
Code: Select all
//  ____  _          _          _     
// / ___|(_)_  __   / \   __  _(_)___
// \___ \| \ \/ /  / _ \  \ \/ / / __|
//  ___) | |>  <  / ___ \  >  <| \__ \
// |____/|_/_/\_\/_/   \_\/_/\_\_|___/

 
//Love racing games, but don't like using the sticks to drive? Try this script, which remaps the sixaxis to one fo the the analog sticks.
 
//Press Select + Start to enable/disable the script, in case the sixaxis features are now expected by the game.
//Press Select + L3/R3 to switch which stick to remap.
 
 
int StickY, StickX, enable, buttonpress;
 
init {
    StickY = PS3_LY;
    StickX = PS3_LX;
    enable = 1
    set_val(TRACE_1, 2);
}
 
 
main {
 
//Selection
buttonpress = get_ptime(PS3_SELECT);
 
// press - send to console
if(event_release(PS3_SELECT) && get_ptime(PS3_SELECT) < 140) {
    combo_run(cpress);
}
// hold - customize part of script
if(get_val(PS3_SELECT) && get_ptime(PS3_SELECT) > 140) {
    combo_run(customize);
}
// Completely block output to console from the controller. If button was pressed, then the press is recreated.
if(get_val(PS3_SELECT)) {
    set_val(PS3_SELECT,0);
}
 
// ----
 
//LY (left stick up/down)
if(enable == 1) {
    if(get_val(PS3_ACCY) > 20) {
        //down
        set_val(StickY, get_val(PS3_ACCY) * 4);
        set_val(PS3_ACCY, 0);
    } else {
        set_val(StickY, get_val(PS3_ACCY) * 4);
        set_val(PS3_ACCY, 0);
    }
}
//LX (left stick left/right)
//Sixaxis X axis is inverted compared to the sticks, automatically fixed here.
if(enable == 1) {
    if(get_val(PS3_ACCX) > 20) {
        //right
        set_val(StickX, get_val(PS3_ACCX) * 4 * -1);
        set_val(PS3_ACCX, 0);
    } else {
        set_val(StickX, get_val(PS3_ACCX) * 4 * -1);
        set_val(PS3_ACCX, 0);
    }
}
}
 
combo customize {
    set_val(TRACE_4, get_val(TRACE_4) + 1);
    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);
}
 
combo cpress {
    set_val(TRACE_3, buttonpress);
    set_val(PS3_SELECT, 100);
    wait(buttonpress);
    set_val(PS3_SELECT, 0);
}