Accessibility: Inaccessible controls Randomiser

This script starts with a 6 profile randomiser and flashing LED colours. The aim is to get across the frustration many players have when they can't fully customise their controls. Help at the bottom of the script.
Version1.01
AuthorSpecialEffect
Publish DateTue, 25 Oct 2016 - 15:54
Last UpdateTue, 25 Oct 2016 - 16:49
Downloads46
RATE


1

0

Release Notes: Sensitivity adjustment fixed.
Code: Select all
// RANDOMISER: Gives a sense of the frustration some players can have when they can't use the controls they wish to.
// Also gives direct access to a range of alternative methods of playing, including left-handed, rotated clockwise, anti-clockwise 90 degrees and upside down.
// Controls help at the bottom of this script.
 
// Created by Barrie Ellis using scripts from OneSwitch.org.uk, SpecialEffect.org.uk and with invaluable help from ConsoleTuner forums and fantastic members.
// Thanks also to Brannon Zahand for his YouTube video of a simpler rotated controller set-up, from which modes 5 and 6 take inspiration.
 
// JOYSTICK SENSITIVITY ADJUSTMENT (FOR A VERY SENSITIVE THUMB-STICK, TRY SENSITIVITY = 327, MIDPOINT = 25, JOY_DEADZONE = 35)
 
 
define SENSITIVITY = 100; // SENSITIVITY (327 MAX).
define MID_POINT = 50; // INPUT MIDPOINT IS (set low for weaker input, 50 for default).
 
define JOY_DEADZONE = 20; // 20 (SMALLEST) -99 (LARGEST) TO ADJUST DEADZONE
define TWEAK = 20; // will add to JOY-DEADZONE - normally useful for one-stick steering
define JOY_BUTTONS_DEADZONE = 80; // JOYSTICK ACTING AS BUTTONS - NEEDS A BIGGER DEADZONE TO AVOID ACCIDENTAL PRESSES
define Z_DEADZONE = 5; // TRIGGERS
define LSTICK_MAX = 100; // ANALOGUE CONTROLS MAXIMUM OUPUT (0-100%)
define RSTICK_MAX = 100;
define TRIGGERS_MAX = 100;
 
// MODES
define START_UP = 0;
define MODE1 = 1;
define MODE2 = 2;
define MODE3 = 3;
define MODE4 = 4;
define MODE5 = 5;
define MODE6 = 6;
 
define RESTRICTED = 0;          // 0 = OFF   1 = BLOCK MENU BUTTON
define EXTRA_RESTRICTIONS = 1// 0 = OFF   1 = BLOCK BACK/SELECT/SHARE/START/OPTIONS
 
int profile = START_UP;
int ModeSwapper;
int LZ;
int RZ;
 
 
 
 
 
 
int X;
 
main {
 
    if (profile == START_UP) { X = X + 1; combo_run(MessUpRandomiser); }
    ps4_set_touchpad(0, X);
 
    if (get_val(PS3_PS) > 0 && !RESTRICTED) profile = 0; set_val(PS3_PS,0);
 
// INITIALISE
 
// SET SENSITIVITY
deadzone(PS3_LX, PS3_LY, DZ_CIRCLE, 0); sensitivity (PS3_LX, MID_POINT, SENSITIVITY);sensitivity (PS3_LY, MID_POINT, SENSITIVITY);
deadzone(PS3_RX, PS3_RY, DZ_CIRCLE, 0); sensitivity (PS3_RX, MID_POINT, SENSITIVITY);sensitivity (PS3_RY, MID_POINT, SENSITIVITY);
 
 
// BLACK MODE 1  (MESSY)
 
        if(profile == MODE1) {
        swap(PS3_CROSS, PS3_L1); swap(PS3_SQUARE, PS3_TRIANGLE); // REMAPPING
        swap(PS3_CIRCLE, PS3_R1);
        swap(PS3_LX, PS3_LY); swap(PS3_RX, PS3_RY); // REMAPPING
        swap(PS3_UP, PS3_RIGHT); swap(PS3_DOWN, PS3_LEFT); // REMAPPING
 
        if(get_val(PS3_SELECT) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_SELECT, 0); }
        if(get_val(PS3_START) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_START, 0); }
 
 
        if(get_val(PS3_LX) <= JOY_DEADZONE && get_val(PS3_LX) >= JOY_DEADZONE*-1) set_val(PS3_LX,0); // DEAD-ZONE FILTER
        if(get_val(PS3_LY) <= JOY_DEADZONE && get_val(PS3_LY) >= JOY_DEADZONE*-1) set_val(PS3_LY,0);
        if(get_val(PS3_L2) <= Z_DEADZONE && get_val(PS3_L2) >= Z_DEADZONE*-1) set_val(PS3_L2,0);
 
        if(get_val(PS3_RX) >= LSTICK_MAX) {set_val(PS3_RX, RSTICK_MAX);} // MAXIMUM STRENGTH LIMITER
        if(get_val(PS3_RX) <= -LSTICK_MAX) {set_val(PS3_RX, -RSTICK_MAX);}
        if(get_val(PS3_LY) >= LSTICK_MAX) {set_val(PS3_LY, LSTICK_MAX);}
        if(get_val(PS3_LY) <= -LSTICK_MAX) {set_val(PS3_LY, -LSTICK_MAX);}
        if(get_val(PS3_L2) >= TRIGGERS_MAX) {set_val(PS3_L2, TRIGGERS_MAX);}
        }
 
 
// BLUE MODE 2   (SHOULDERS VERY AWKWARD TO REACH - CAN ONLY ACTIVATE SHOULDER BUTTONS IF HOLD L3 + R3)
 
        if(profile == MODE2) {   
 
        if(get_val(PS3_L3) == 0 || get_val(PS3_R3) == 0) {set_val(PS3_L1,0); set_val(PS3_L2,0); set_val(PS3_R1,0); set_val(PS3_R2,0); }
 
        if(get_val(PS3_SELECT) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_SELECT, 0); }
        if(get_val(PS3_START) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_START, 0); }
 
        if(get_val(PS3_LX) <= JOY_DEADZONE && get_val(PS3_LX) >= JOY_DEADZONE*-1) set_val(PS3_LX,0); // DEAD-ZONE FILTER
        if(get_val(PS3_LY) <= JOY_DEADZONE && get_val(PS3_LY) >= JOY_DEADZONE*-1) set_val(PS3_LY,0);
        if(get_val(PS3_L2) <= Z_DEADZONE && get_val(PS3_L2) >= Z_DEADZONE*-1) set_val(PS3_L2,0);
 
        if(get_val(PS3_RX) <= JOY_DEADZONE && get_val(PS3_RX) >= JOY_DEADZONE*-1) set_val(PS3_RX,0); // DEAD-ZONE FILTER R-STICK
        if(get_val(PS3_RY) <= JOY_DEADZONE && get_val(PS3_RY) >= JOY_DEADZONE*-1) set_val(PS3_RY,0);
        if(get_val(PS3_R2) <= Z_DEADZONE && get_val(PS3_R2) >= Z_DEADZONE*-1) set_val(PS3_R2,0);
 
        if(get_val(PS3_LX) >= LSTICK_MAX) {set_val(PS3_LX, LSTICK_MAX);} // MAXIMUM STRENGTH LIMITER
        if(get_val(PS3_LX) <= -LSTICK_MAX) {set_val(PS3_LX, -LSTICK_MAX);}
        if(get_val(PS3_LY) >= LSTICK_MAX) {set_val(PS3_LY, LSTICK_MAX);}
        if(get_val(PS3_LY) <= -LSTICK_MAX) {set_val(PS3_LY, -LSTICK_MAX);}
 
        }
 
 
// RED MODE 3    (BASIC LEFT HANDED MODE)
 
        if(profile == MODE3) {
        swap(PS3_L1, PS3_R1); swap(PS3_L2, PS3_R2); // REMAPPING
        swap(PS3_L3, PS3_R3);
        swap(PS3_LX, PS3_RX); swap(PS3_LY, PS3_RY);
 
        swap(PS3_CROSS, PS3_DOWN); swap(PS3_TRIANGLE, PS3_UP);
        swap(PS3_SQUARE, PS3_LEFT); swap(PS3_CIRCLE, PS3_RIGHT);
 
        if(get_val(PS3_SELECT) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_SELECT, 0); }
        if(get_val(PS3_START) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_START, 0); }
 
        if(get_val(PS3_LX) <= JOY_DEADZONE && get_val(PS3_LX) >= JOY_DEADZONE*-1) set_val(PS3_LX,0); // DEAD-ZONE FILTER
        if(get_val(PS3_LY) <= JOY_DEADZONE && get_val(PS3_LY) >= JOY_DEADZONE*-1) set_val(PS3_LY,0);
        if(get_val(PS3_L2) <= Z_DEADZONE && get_val(PS3_L2) >= Z_DEADZONE*-1) set_val(PS3_L2,0);
 
        if(get_val(PS3_RX) <= JOY_DEADZONE && get_val(PS3_RX) >= JOY_DEADZONE*-1) set_val(PS3_RX,0); // DEAD-ZONE FILTER R-STICK
        if(get_val(PS3_RY) <= JOY_DEADZONE && get_val(PS3_RY) >= JOY_DEADZONE*-1) set_val(PS3_RY,0);
        if(get_val(PS3_R2) <= Z_DEADZONE && get_val(PS3_R2) >= Z_DEADZONE*-1) set_val(PS3_R2,0);
 
        if(get_val(PS3_LX) >= LSTICK_MAX) {set_val(PS3_LX, LSTICK_MAX);} // MAXIMUM STRENGTH LIMITER
        if(get_val(PS3_LX) <= -LSTICK_MAX) {set_val(PS3_LX, -LSTICK_MAX);}
        if(get_val(PS3_LY) >= LSTICK_MAX) {set_val(PS3_LY, LSTICK_MAX);}
        if(get_val(PS3_LY) <= -LSTICK_MAX) {set_val(PS3_LY, -LSTICK_MAX);}
 
        }
 
 
// GREEN MODE 4    (UPSIDE DOWN MODE)
 
        if(profile == MODE4) {
 
        swap(PS3_TRIANGLE, PS3_DOWN); swap(PS3_CROSS, PS3_UP); // REMAPPING
        swap(PS3_SQUARE, PS3_RIGHT); swap(PS3_CIRCLE, PS3_LEFT); // REMAPPING
 
//        swap(PS3_TRIANGLE, PS3_CROSS); swap(PS3_CIRCLE, PS3_SQUARE); // ALTERNTIVE CURSOR / SHAPES/ABXY REMAPPING
//        swap(PS3_UP, PS3_DOWN); swap(PS3_LEFT, PS3_RIGHT); //
 
        swap(PS3_LX, PS3_RX); swap(PS3_LY, PS3_RY); // REMAPPING
        swap(PS3_L1, PS3_R1); swap(PS3_L2, PS3_R2); // REMAPPING
        swap(PS3_L3, PS3_R3);
        swap(PS3_START, PS3_SELECT);
 
        if(get_val(PS3_LX) > JOY_DEADZONE) {set_val(PS3_LX, get_val(PS3_LX)*-1);} else {set_val(PS3_LX, get_val(PS3_LX)*-1);} // LX INVERTED
        if(get_val(PS3_RX) > JOY_DEADZONE) {set_val(PS3_RX, get_val(PS3_RX)*-1);} else {set_val(PS3_RX, get_val(PS3_RX)*-1);} // RX INVERTED
 
        if(get_val(PS3_LY) > JOY_DEADZONE) {set_val(PS3_LY, get_val(PS3_LY)*-1);} else {set_val(PS3_LY, get_val(PS3_LY)*-1);} // LY INVERTED
        if(get_val(PS3_RY) > JOY_DEADZONE) {set_val(PS3_RY, get_val(PS3_RY)*-1);} else {set_val(PS3_RY, get_val(PS3_RY)*-1);} // RY INVERTED
 
        if(get_val(PS3_LX) <= JOY_DEADZONE && get_val(PS3_LX) >= JOY_DEADZONE*-1) set_val(PS3_LX,0); // DEAD-ZONE FILTER
        if(get_val(PS3_LY) <= JOY_DEADZONE && get_val(PS3_LY) >= JOY_DEADZONE*-1) set_val(PS3_LY,0);
        if(get_val(PS3_L2) <= Z_DEADZONE && get_val(PS3_L2) >= Z_DEADZONE*-1) set_val(PS3_L2,0);
 
        if(get_val(PS3_RX) <= JOY_DEADZONE && get_val(PS3_RX) >= JOY_DEADZONE*-1) set_val(PS3_RX,0); // DEAD-ZONE FILTER R-STICK
        if(get_val(PS3_RY) <= JOY_DEADZONE && get_val(PS3_RY) >= JOY_DEADZONE*-1) set_val(PS3_RY,0);
        if(get_val(PS3_R2) <= Z_DEADZONE && get_val(PS3_R2) >= Z_DEADZONE*-1) set_val(PS3_R2,0);
 
        if(get_val(PS3_LX) >= LSTICK_MAX) {set_val(PS3_LX, LSTICK_MAX);} // MAXIMUM STRENGTH LIMITER
        if(get_val(PS3_LX) <= -LSTICK_MAX) {set_val(PS3_LX, -LSTICK_MAX);}
        if(get_val(PS3_LY) >= LSTICK_MAX) {set_val(PS3_LY, LSTICK_MAX);}
        if(get_val(PS3_LY) <= -LSTICK_MAX) {set_val(PS3_LY, -LSTICK_MAX);}
 
 
        if(get_val(PS3_SELECT) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_SELECT, 0); }
        if(get_val(PS3_START) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_START, 0); }
 
        }
 
 
// PINK MODE 5    (ROTATE 90DEG CLOCKWISE - GRIPS POINT LEFT)
 
        if(profile == MODE5) {
        swap(XB1_LS, XB1_RS); // REMAPPING
        swap(PS3_LX, PS3_RY); swap(PS3_LY, PS3_RX);
 
        if(get_val(PS3_LX) > JOY_DEADZONE) {set_val(PS3_LX, get_val(PS3_LX)*-1);} else {set_val(PS3_LX, get_val(PS3_LX)*-1);} // LX INVERTED
        if(get_val(PS3_RX) > JOY_DEADZONE) {set_val(PS3_RX, get_val(PS3_RX)*-1);} else {set_val(PS3_RX, get_val(PS3_RX)*-1);} // RX INVERTED
 
        if(get_val(PS3_LY) > JOY_DEADZONE) {set_val(PS3_LY, get_val(PS3_LY));} else {set_val(PS3_LY, get_val(PS3_LY));} // LY INVERTED
        if(get_val(PS3_RY) > JOY_DEADZONE) {set_val(PS3_RY, get_val(PS3_RY));} else {set_val(PS3_RY, get_val(PS3_RY));} // RY INVERTED
 
        if(get_val(PS3_SELECT) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_SELECT, 0); }
        if(get_val(PS3_START) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_START, 0); }
 
        swap(XB1_UP, XB1_RIGHT); // REMAPPING
        swap(XB1_DOWN, XB1_LEFT);
        swap(XB1_UP, XB1_DOWN);
 
        if(get_val(PS3_LX) <= JOY_DEADZONE && get_val(PS3_LX) >= JOY_DEADZONE*-1) set_val(PS3_LX,0); // DEAD-ZONE FILTER
        if(get_val(PS3_LY) <= JOY_DEADZONE && get_val(PS3_LY) >= JOY_DEADZONE*-1) set_val(PS3_LY,0);
        if(get_val(PS3_L2) <= Z_DEADZONE && get_val(PS3_L2) >= Z_DEADZONE*-1) set_val(PS3_L2,0);
 
        if(get_val(PS3_RX) <= JOY_DEADZONE && get_val(PS3_RX) >= JOY_DEADZONE*-1) set_val(PS3_RX,0); // DEAD-ZONE FILTER R-STICK
        if(get_val(PS3_RY) <= JOY_DEADZONE && get_val(PS3_RY) >= JOY_DEADZONE*-1) set_val(PS3_RY,0);
        if(get_val(PS3_R2) <= Z_DEADZONE && get_val(PS3_R2) >= Z_DEADZONE*-1) set_val(PS3_R2,0);
 
        if(get_val(PS3_LX) >= LSTICK_MAX) {set_val(PS3_LX, LSTICK_MAX);} // MAXIMUM STRENGTH LIMITER
        if(get_val(PS3_LX) <= -LSTICK_MAX) {set_val(PS3_LX, -LSTICK_MAX);}
        if(get_val(PS3_LY) >= LSTICK_MAX) {set_val(PS3_LY, LSTICK_MAX);}
        if(get_val(PS3_LY) <= -LSTICK_MAX) {set_val(PS3_LY, -LSTICK_MAX);}
 
        }
 
 
// WHITE MODE 6    (ROTATE 90DEG ANTI-CLOCKWISE - GRIPS POINT RIGHT)
 
        if(profile == MODE6) {
        swap(PS3_LX, PS3_LY); swap(PS3_RX, PS3_RY); // REMAPPING
 
        if(get_val(PS3_LX) > JOY_DEADZONE) {set_val(PS3_LX, get_val(PS3_LX));} else {set_val(PS3_LX, get_val(PS3_LX));} // LX INVERTED
        if(get_val(PS3_RX) > JOY_DEADZONE) {set_val(PS3_RX, get_val(PS3_RX));} else {set_val(PS3_RX, get_val(PS3_RX));} // RX INVERTED
 
        if(get_val(PS3_LY) > JOY_DEADZONE) {set_val(PS3_LY, get_val(PS3_LY)*-1);} else {set_val(PS3_LY, get_val(PS3_LY)*-1);} // LY INVERTED
        if(get_val(PS3_RY) > JOY_DEADZONE) {set_val(PS3_RY, get_val(PS3_RY)*-1);} else {set_val(PS3_RY, get_val(PS3_RY)*-1);} // RY INVERTED
 
        if(get_val(PS3_SELECT) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_SELECT, 0); }
        if(get_val(PS3_START) > 0 && EXTRA_RESTRICTIONS) { set_val(PS3_START, 0); }
 
        swap(XB1_UP, XB1_LEFT); // REMAPPING
        swap(XB1_UP, XB1_RIGHT);
        swap(XB1_DOWN, XB1_RIGHT);
 
        if(get_val(PS3_LX) <= JOY_DEADZONE && get_val(PS3_LX) >= JOY_DEADZONE*-1) set_val(PS3_LX,0); // DEAD-ZONE FILTER
        if(get_val(PS3_LY) <= JOY_DEADZONE && get_val(PS3_LY) >= JOY_DEADZONE*-1) set_val(PS3_LY,0);
        if(get_val(PS3_L2) <= Z_DEADZONE && get_val(PS3_L2) >= Z_DEADZONE*-1) set_val(PS3_L2,0);
 
        if(get_val(PS3_RX) <= JOY_DEADZONE && get_val(PS3_RX) >= JOY_DEADZONE*-1) set_val(PS3_RX,0); // DEAD-ZONE FILTER R-STICK
        if(get_val(PS3_RY) <= JOY_DEADZONE && get_val(PS3_RY) >= JOY_DEADZONE*-1) set_val(PS3_RY,0);
        if(get_val(PS3_R2) <= Z_DEADZONE && get_val(PS3_R2) >= Z_DEADZONE*-1) set_val(PS3_R2,0);
 
        if(get_val(PS3_LX) >= LSTICK_MAX) {set_val(PS3_LX, LSTICK_MAX);} // MAXIMUM STRENGTH LIMITER
        if(get_val(PS3_LX) <= -LSTICK_MAX) {set_val(PS3_LX, -LSTICK_MAX);}
        if(get_val(PS3_LY) >= LSTICK_MAX) {set_val(PS3_LY, LSTICK_MAX);}
        if(get_val(PS3_LY) <= -LSTICK_MAX) {set_val(PS3_LY, -LSTICK_MAX);}
        }
 
 
}
 
combo MessUpRandomiser {
 
    ps4_set_touchpad(0, X);
    if (X > 6) X = 1;
 
    if (X == 1) colorled(0,0,0,0); // BLACK MODE 1
    if (X == 2) colorled(2,0,0,0); // BLUE MODE 2
    if (X == 3) colorled(0,2,0,0); // RED MODE 3
    if (X == 4) colorled(0,0,2,0); // GREEN MODE 4
    if (X == 5) colorled(0,0,0,2); // PINK MODE 5
    if (X == 6) colorled(2,2,2,2); // WHITE MODE 6
 
    if (get_val(PS3_PS) > 0) profile = X;
    if (get_val(PS3_UP) > 0) profile = X;
    if (get_val(PS3_RIGHT) > 0) profile = X;
    if (get_val(PS3_DOWN) > 0) profile = X;
    if (get_val(PS3_LEFT) > 0) profile = X;
    if (get_val(PS3_CROSS) > 0) { X=1; colorled(0,0,0,0); profile = X; } 
    if (get_val(PS3_CIRCLE) > 0) { X=2; colorled(2,0,0,0); profile = X; }
    if (get_val(PS3_SQUARE) > 0) { X=3; colorled(0,2,0,0); profile = X; }
    if (get_val(PS3_TRIANGLE) > 0) { X=4; colorled(0,0,2,0); profile = X; }
    if (get_val(PS3_L1) > 0) { X=5; colorled(0,0,0,2); profile = X; }
    if (get_val(PS3_R1) > 0) { X=6; colorled(2,2,2,2); profile = X; }
 
 
}
 
 
 
 
 
 
// COLOR LED INDICATION for PS4 *NO NEED TO EDIT BELOW*
//--------------------------------------------------------------
function colorled(a,b,c,d) {
set_led(LED_1,a);
set_led(LED_2,b);
set_led(LED_3,c);
set_led(LED_4,d);
}
 
// colorled(0,0,0,0); // Off / No LED light
// colorled(1,0,0,0); // Dim Blue
// colorled(0,1,0,0); // Dim Red
// colorled(0,0,1,0); // Dim Lime/Green
// colorled(0,0,0,1); // Dim Fuchsia/Pink
// colorled(1,0,1,0); // Dim SkyBlue
// colorled(0,1,1,0); // Dim Yellow
// colorled(1,1,1,1); // Dim White
// colorled(2,0,0,0); // Blue 
// colorled(0,2,0,0); // Red
// colorled(0,0,2,0); // Lime/Green
// colorled(0,0,0,2); // Fuchsia/Pink
// colorled(2,0,2,0); // SkyBlue
// colorled(0,2,2,0); // Yellow
// colorled(2,2,2,2); // White
// colorled(3,0,0,0); // Bright Blue
// colorled(0,3,0,0); // Bright Red
// colorled(0,0,3,0); // Bright Lime/Green
// colorled(0,0,0,3); // Bright Fuchsia/Pink
// colorled(3,0,3,0); // Bright SkyBlue
// colorled(0,3,3,0); // Bright Yellow
// colorled(3,3,3,3); // Bright white
 
 
//  Press the d-pad to pick a random profile from the following:
 
//  1. Messy configuration.
//  2. Shoulders tricky to reach (have to press both stick buttons to enable).
//  3. Left-handed.
//  4. Upside down.
//  5. +90� (grips point leftwards).
//  6. -90� (grips point rightwards).
 
//  Use the Xbox/PS button to restart the randomiser.
 
//  You can also select from the six profiles deliberately, which might be quite useful as a way to try different ways of playing.
 
//  CROSS / A = Mode 1 (messy)
//  CIRCLE / B = Mode 2 (tricky shoulders)
//  SQUARE / X = Mode 3 (left-handed)
//  TRIANGLE / Y = Mode 4 (upside down)
//  L1 / LB = Mode 5 (+90�)
//  R1 / RB = Mode 6 (-90�) \0�)