Global advanced sensitivity for Wii controller V2

You need to add your buttons configuration
Version1.1
AuthorNicoreda
Publish DateThu, 7 Sep 2017 - 21:08
Last UpdateThu, 7 Sep 2017 - 21:08
Downloads15
RATE


0

0

Release Notes: Fixed. Added COD Config
Code: Select all
 
/* Started from a base of Wiimot3 script (he know that, we work together) */
/* Only wiimote sensitivity is implemented, you can use firsts values to tweak changes.
You will need to add your own input for buttons and others movements, or adding from existing scripts.
 
WARNING: This script use WII_RX and WII_RY as sensor sensitivity. You can't use both of them to change anything but IR.
 
Creator: Nicoreda
Main help: Wiimot3
 
Customizable values at the start of main {}
*/

 
 
    unmap ALL_REMAPS;
 
    remap  WII_RX       -> PS4_RX;
    remap  WII_RY       -> PS4_RY;
    remap WII_X -> PS4_SQUARE;
    remap WII_Y -> PS4_R3;
    remap  WII_ACCNZ    -> PS4_CIRCLE;
    remap  WII_ZR       -> PS4_DOWN;
    remap  WII_UP       -> PS4_UP;
    remap  WII_A     -> PS4_CROSS;       
    remap  WII_LEFT     -> PS4_LEFT;
    remap  WII_RIGHT    -> PS4_RIGHT;
    remap WII_HOME -> PS4_PS;
    remap WII_ONE -> PS4_TOUCH;
    remap WII_TWO -> PS4_OPTIONS;
    remap WII_ONE -> PS4_R1;
    remap WII_TWO -> PS4_L1;
    remap WII_Z -> PS4_L3;
    remap WII_C -> PS4_L2;
    remap WII_B -> PS4_R2;
    remap  WII_NX       -> PS4_LX;
    remap  WII_NY       -> PS4_LY;   
//remap WII_ZL -> PS4_PS;
    int var_irx;
    int var_iry;
    int var_radx;
    int var_rady;
    int var_radian;
    int var_radian2;
    int var_newx;
    int var_newy;
    int var_testx;
    int var_testy;
    int var_signx;
    int var_signy;
    int var_signx2;
    int var_signy2;
    int var_rasterize;
 
    int var_deadsight;
    int var_speed;
    int var_deadzone_value;
    int var_radianspeed;
 
main {
        //EASY CUSTOMISATION BEGIN
        //EASY CUSTOMISATION BEGIN
        //EASY CUSTOMISATION BEGIN
        //EASY CUSTOMISATION BEGIN
        //EASY CUSTOMISATION BEGIN
        //EASY CUSTOMISATION BEGIN
 
        //Main speed of the first movement. Default is 30.
        var_speed = 149;
 
        //Speed in longer distance. Default is 2.
        var_radianspeed = 1;
 
        //First deadzone done for Infrared position without any calcs. Default is 10.
        var_deadzone_value = 1;
 
        //Additionnal anti-deadzone for first movement speed. Default is 1.
        var_deadsight = 1;
 
        //EASY CUSTOMISATION END
        //EASY CUSTOMISATION END
        //EASY CUSTOMISATION END
        //EASY CUSTOMISATION END
        //EASY CUSTOMISATION END
        //EASY CUSTOMISATION END
        //EASY CUSTOMISATION END
 
 
        set_val(WII_IRX, inv(get_val(WII_IRX)));
        sensitivity(WII_IRX , 35, 100);
        sensitivity(WII_IRY ,35 , 100);
        deadzone(WII_IRX, WII_IRY, DZ_CIRCLE, var_deadzone_value);
        stickize(PS4_RX, PS4_RY, 120);
        deadzone(WII_RX, WII_RY, DZ_CIRCLE, 21);
    if (var_irx <= 0 ){
        var_signx = -3;
    }else{
        var_signx = var_deadsight;
    }
       if (var_iry <= 0 ){
        var_signy = inv(var_deadsight);
    }else{
        var_signy = var_deadsight;
    }
        if (var_irx < 0 ){
        var_signx2 = -1;
    }else{
        var_signx2 = 1;
    }
       if (var_iry < 0 ){
        var_signy2 = -1;
    }else{
        var_signy2 = 1;
    }
    var_irx = get_val(WII_IRX);
    var_iry = get_val(WII_IRY);
   // var_radian = isqrt( (abs(var_irx )  + abs(var_iry  ))  );
    var_testx = var_signx2 * (isqrt(var_irx * var_speed) /3);
    var_testy = var_signy2 * (isqrt(var_iry * var_speed) / 3);
    deadzone(PS4_RX, PS4_RY, DZ_CIRCLE, var_deadzone_value);   
    var_newx = ( (((var_irx)/2) * var_radianspeed) + var_signx + var_testx);
    var_newy = ( (((var_iry )/2) * var_radianspeed) + var_signy + var_testy) ;
if (var_newx > 100){
 var_newx = 100;
}
if (var_newy > 100){
 var_newy = 100;
}
if (var_newx < -100){
 var_newx = -100;
}
if (var_newy < -100){
 var_newy = -100;
}
 
 
        set_val(TRACE_3,var_radx);
    set_val(TRACE_4,var_rady);
        set_val(TRACE_1,var_newx);
    set_val(TRACE_2,var_newy);
 set_val(TRACE_5,var_testx);
    set_val(WII_RX, var_newx);
    set_val(WII_RY, var_newy);
 
 
set_val(PS4_OPTIONS, 100);
// PUT ALL INPUTS AFTER THIS LINE.
if (get_val(WII_ACCNX) < -15) { set_val(WII_X, 100);} else {  set_val(WII_X, 0); }
if (get_val(WII_ACCNX) > 15) { set_val(WII_Y, 100);} else {  set_val(WII_Y, 0); }
if (get_val(WII_ACCNY) < -15) { set_val(WII_ACCNZ, 100);} else {  set_val(WII_ACCNZ, 0); }
if (get_val(WII_DOWN) > 15) { set_val(WII_ZR, 100);} else {  set_val(WII_ZR, 0); }
    sensitivity(WII_NX , NOT_USE, 150);
    sensitivity(WII_NY , NOT_USE, 200);   
    stickize(PS4_LX, PS4_LY, 100);
    deadzone(WII_NX, WII_NY, DZ_CIRCLE, 10);
}