Accessibility: Two Switches (Toggle Walk & Look Left/Right)

This script enables the L3 and R3 buttons to explore a world, such as Proteus on the PS3. L3 = Forward movement on/off (R-Stick UP) R3 = Look left or right alternately whilst held. For more on accessible gaming, see SpecialEffect at www.SpecialEffect.org.uk.
Version1.00
AuthorSpecialEffect
Publish DateSat, 4 Jul 2015 - 10:13
Last UpdateSat, 4 Jul 2015 - 10:13
Downloads27
RATE


1

0

Release Notes: Huge thanks to all involved in the creation of this script.
Code: Select all
// Script for Special Effect
// see the posts below as reference
// viewtopic.php?f=6&t=1210
// viewtopic.php?f=6&t=1795&p=12979#p12979
 
define forward_val = 70;
define side_val = 70;
define DeadZoneLeftStick = 20;
 
int ForwardToggleON = FALSE;
int LeftMovementToggle = FALSE; // FALSE = move right; TRUE = move left;
int timer, stop;
 
 
main {
  // Dead Zone Detection
  if ( get_val(PS3_LX) >= -DeadZoneLeftStick && get_val(PS3_LX) <= DeadZoneLeftStick) {set_val(PS3_LX,0);}
  if ( get_val(PS3_LY) >= -DeadZoneLeftStick && get_val(PS3_LY) <= DeadZoneLeftStick) {set_val(PS3_LY,0);}
 
  // Forward Movement
  if (event_press(PS3_L3)) {ForwardToggleON = !ForwardToggleON;} // Toggles forward movement on/off
  if (ForwardToggleON) {set_val(PS3_LY,-forward_val);set_val(PS4_L3, 0);} // -value is move forward; +value is move backwards     ; Swallow L3 button whilst turning on movement
  if (!ForwardToggleON) {set_val(PS4_L3, 0);} //                                                                                  ; Swallow L3 button whilst turning off movement
 
  // Side to Side Movement
  if (event_press(PS3_R3)) {LeftMovementToggle = !LeftMovementToggle;} // Toggles between left and right movements
  if (get_val(PS3_R3) && LeftMovementToggle) {set_val(PS3_RX,-side_val);set_val(PS4_R3, 0);} // -value is move left     ; Swallow R3 button whilst looking left.
  if (get_val(PS3_R3) && !LeftMovementToggle) {set_val(PS3_RX,side_val);set_val(PS4_R3, 0);} // +value is move right    ; Swallow R3 button whilst steering right.
 
}