Difference between revisions of "0494"

From GTAMods Wiki
Jump to navigation Jump to search
 
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<code>0494=5,%1h% %2d% %3d% %4d% %5d% </code><br>
+
{{OpCode
'''Description''': Gets the joystick data<br>
+
| games      = {{Icon|t}}
'''Parameter 1''': Controller number (usually 0)<br>
+
| command    = GET_POSITION_OF_ANALOGUE_STICKS
'''Parameter 2''': Value to store the integer<br>
+
| description = Gets the position of the analogue sticks
'''Parameter 3''': Value to store the integer<br>
+
| syntax1    = 0494: get_joystick [''int''] data_to [''var1''] [''var2''] [''var3''] [''var4'']
'''Parameter 4''': Value to store the integer<br>
+
| p1t        = [''int1'']
'''Parameter 5''': Value to store the integer<br>
+
| p1d        = Pad, normally 0 for pad 1 (player 1), 1 for pad 2 (player 2)
'''Supports''': GTA3, Vice City, San Andreas<br>
+
| p2t        = [''var1'']
 +
| 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>
+
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]].
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|keypresses]].
+
== Keywords ==
 
+
get, position, analog, analogue, stick, sticks, joystick, data
==Keywords==
 
get, joystick
 
 
 
[[Category:OpCodes]]
 

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