SixAxis remapper

This will remap one of the sticks to the X/Y axises of the Sixaxis, useful if you want to use the sticks instead of the sixaxis, or if you are using a controller without support for it. Tested with "Bentley's Hackpack". Controls: While holding Select: Start to enable/disable the remap, L3/R3 to switch which stick is remapped, PS button (plus you must use a Wiimote) to use Wii IR.
Version1.7
AuthorCypherNova139
Publish DateSun, 11 May 2014 - 00:43
Last UpdateFri, 20 Jun 2014 - 03:16
Downloads238
RATE


6

0

Release Notes: Added support for Wii remote IR. Tested with "Bentley's Hackpack" again, and accuracy: Needs work. At least you can have some fun with ur Wiimotes now.
Code: Select all
//  ____  _          _          _     
// / ___|(_)_  __   / \   __  _(_)___
// \___ \| \ \/ /  / _ \  \ \/ / / __|
//  ___) | |>  <  / ___ \  >  <| \__ \
// |____/|_/_/\_\/_/   \_\/_/\_\_|___/

 
//If you have issues using the DS3/4's Sixaxis features, or are using a different controller without those features, this script remaps one of the sticks to the Sixaxis Y & X axises.
 
//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, buttonpress;
 
init {
    StickY = PS3_LY;
    StickX = PS3_LX;
    enable = 1
    set_val(TRACE_1, 2);
}
 
 
main {
 
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_LY) > 20) {
        //down
        set_val(PS3_ACCY, get_val(StickY));
        set_val(StickY, 0);
    } else {
        set_val(PS3_ACCY, get_val(StickY));
        set_val(StickY, 0);
    }
}
//LX (left stick left/right)
//Sixaxis X axis is inverted compared to the PS3 sticks, automatically fixed here.
//If using Wii inversion is not need.
if(enable == 1) {
    if(get_val(PS3_LX) > 20) {
        //right
        if(get_controller() == PIO_WII) {
            set_val(PS3_ACCX, get_val(StickX));
        } else {
            set_val(PS3_ACCX, get_val(StickX) * -1);
        }
        set_val(StickX, 0);
    } else {
        if(get_controller() == PIO_WII) {
            set_val(PS3_ACCX, get_val(StickX));
        } else {
            set_val(PS3_ACCX, get_val(StickX) * -1);
        }
        set_val(StickX, 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
    }
//Use Wii IR
    if(event_press(PS3_PS) && get_controller() == PIO_WII) {
        StickY = WII_IRY
        StickX = WII_IRX
    }
    set_val(PS3_START, 0);
    set_val(PS3_L3, 0);
    set_val(PS3_R3, 0);
    set_val(PS3_PS, 0);
//    set_val(PS3_SELECT,0);
}
 
combo cpress {
    set_val(TRACE_3, buttonpress);
    set_val(PS3_SELECT, 100);
    wait(buttonpress);
    set_val(PS3_SELECT, 0);
}