0494

From GTAMods Wiki
Jump to navigation Jump to search

GTA III Vice City San Andreas GET_POSITION_OF_ANALOGUE_STICKS


Description
Gets the position of the analogue sticks
Syntax
0494: get_joystick [int] data_to [var1] [var2] [var3] [var4]
Parameter
[int1]
Pad, normally 0 for pad 1 (player 1), 1 for pad 2 (player 2)
[var1]
Variable to store the integer position of button 0 (LEFTSTICKX), -128 left to 128 right
[var2]
Variable to store the integer position of button 1 (LEFTSTICKY), -128 up to 128 down
[var3]
Variable to store the integer position of button 2 (RIGHTSTICKX), -128 left to 128 right
[var4]
Variable to store the integer position of button 3 (RIGHTSTICKY), -128 up to 128 down

This opcode gets the position of the analogue sticks. Pushing the stick to the maximum positions yields a value of -128 or 128 depending on the direction, and any position in between yields a value between those two extremes. On a keyboard, the opcode will always return the extreme values. It is a useful alternative for detecting buttons 0 to 3.

Keywords

get, position, analog, analogue, stick, sticks, joystick, data