Difference between revisions of "0494"

From GTAMods Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{OpCode
 
{{OpCode
| ini        = 0494=5,%1h% %2d% %3d% %4d% %5d%
+
| games      = {{Icon|t}}
| description = Gets the joystick data
+
| command    = GET_POSITION_OF_ANALOGUE_STICKS
| p1          = Controller number (usually 0)
+
| description = Gets the position of the analogue sticks
| p2          = Value to store the integer
+
| syntax1    = 0494: get_joystick [''int''] data_to [''var1''] [''var2''] [''var3''] [''var4'']
| p3          = Value to store the integer
+
| p1t        = [''int1'']
| p4          = Value to store the integer
+
| p1d        = Pad, normally 0 for pad 1 (player 1), 1 for pad 2 (player 2)
| p5          = Value to store the integer
+
| p2t        = [''var1'']
| game        = [[GTA 3]], [[Vice City]], [[San Andreas]]
+
| p2d        = Variable to store the integer position of [[00E1|button 0]] (LEFTSTICKX), -128 left to 128 right
 +
| p3t        = [''var2'']
 +
| p3d        = Variable to store the integer position of button 1 (LEFTSTICKY), -128 up to 128 down
 +
| p4t        = [''var3'']
 +
| p4d        = Variable to store the integer position of button 2 (RIGHTSTICKX), -128 left to 128 right
 +
| p5t        = [''var4'']
 +
| p5d        = Variable to store the integer position of button 3 (RIGHTSTICKY), -128 up to 128 down
 
}}
 
}}
Parameter 1 returns -128 when pressing the left button and 128 when pressing the right button.<br>
 
Parameter 2 returns -128 when pressing the up button and 128 when pressing the down button.<br>
 
Parameter 3 returns -128 when pressing the special control left button and 128 when pressing the special control right button.<br>
 
Parameter 4 returns -128 when pressing the special control up button and 128 when pressing the special control down button.<br>
 
  
This opcode is a useful alternate way of detecting certain [[00E1|key presses]].
+
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 [[00E1|buttons 0 to 3]].
  
==Keywords==
+
== Keywords ==
get, joystick
+
get, position, analog, analogue, stick, sticks, joystick, data

Latest revision as of 07:20, 5 June 2016

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