/*If you want to customize the KEYS that are used for movement and you are using the Movement.wdl then add this to your level script or save it as a .wdl file and INCLUDE it after the default movement INCLUDE. This script uses the A, D, W, & S KEYS instead of the ARROW KEYS, however you can easily change it to your liking by substituting the above mentioned KEYS located at the commented LEFT & RIGHT ARROWS and UP & DOWN ARROWS lines. */ function _player_intentions() { // Set the angular forces according to the player intentions aforce.PAN = -astrength.PAN*(KEY_D-KEY_A+JOY_FORCE.X);///////////////////////// LEFT & RIGHT ARROWS aforce.TILT = astrength.TILT*(KEY_PGUP-KEY_PGDN); IF (MOUSE_MODE == 0) { // Mouse switched off? aforce.PAN += -astrength.PAN*MOUSE_FORCE.X*mouseview; aforce.TILT += astrength.TILT*MOUSE_FORCE.Y*mouseview; } aforce.ROLL = 0; // Set ROLL force if ALT was pressed IF (KEY_ALT != 0) { aforce.ROLL = aforce.PAN; aforce.PAN = 0; } // Double the forces in case the player pressed SHIFT IF (KEY_SHIFT != 0) { aforce.PAN += aforce.PAN; aforce.TILT += aforce.TILT; aforce.ROLL += aforce.ROLL; } // Limit the forces in case the player // pressed buttons, mouse and joystick simultaneously limit.PAN = 2*astrength.PAN; limit.TILT = 2*astrength.TILT; limit.ROLL = 2*astrength.ROLL; IF (aforce.PAN > limit.PAN) { aforce.PAN = limit.PAN; } IF (aforce.PAN < -limit.PAN) { aforce.PAN = -limit.PAN; } IF (aforce.TILT > limit.TILT) { aforce.TILT = limit.TILT; } IF (aforce.TILT < -limit.TILT) { aforce.TILT = -limit.TILT; } IF (aforce.ROLL > limit.ROLL) { aforce.ROLL = limit.ROLL; } IF (aforce.ROLL < -limit.ROLL) { aforce.ROLL = -limit.ROLL; } // Set the cartesian forces according to the player intentions force.X = strength.X*(KEY_W-KEY_S+JOY_FORCE.Y);/////////////////////////////////// UP & DOWN ARROWS force.Y = strength.Y*(KEY_COMMA-KEY_PERIOD); force.Z = strength.Z*(KEY_HOME-KEY_END); IF (MOUSE_MODE == 0) { // Mouse switched off? force.X += strength.X*MOUSE_RIGHT*mouseview; } // Double the forces in case the player pressed SHIFT IF (KEY_SHIFT != 0) { force.X += force.X; force.Y += force.Y; force.Z += force.Z; } // Limit the forces in case the player tried to cheat by // operating buttons, mouse and joystick simultaneously limit.X = 2*strength.X; limit.Y = 2*strength.Y; limit.Z = 2*strength.Z; IF (force.X > limit.X) { force.X = limit.X; } IF (force.X < -limit.X) { force.X = -limit.X; } IF (force.Y > limit.Y) { force.Y = limit.Y; } IF (force.Y < -limit.Y) { force.Y = -limit.Y; } IF (force.Z > limit.Z) { force.Z = limit.Z; } IF (force.Z < -limit.Z) { force.Z = -limit.Z; } }