Difference between revisions of "0400"

From GTAMods Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
{{OpCode
+
<code>0400=1,%1d%</code><br>
| ini        = 0400=7,%5d% %6d% %7d% %1d% %2d% %3d% %4d%
+
<code>0400=7,%5d% %6d% %7d% %1d% %2d% %3d% %4d%</code><br>
| description = Gets the offset of the object's position
+
'''Description''': Gets the offset of the object's position
| p1          = Existing object handle
+
{| cellpadding="0" cellspacing="0"
| p2          = Float (X-offset in [[unit]]s)
+
!
| p3          = Float (Y-offset in units)
+
!{{Icon|3}}
| p4          = Float (Z-offset in units)
+
!{{Icon|VC}} {{Icon|SA}} {{Icon|LCS}} {{Icon|VCS}}
| p5          = Variable to store the X-coordinate of the X-offset
+
|-
| p6          = Variable to store the Y-coordinate of the Y-offset
+
| '''Parameter 1''':&nbsp; || Integer value&nbsp; || Existing object handle
| p7          = Variable to store the Z-coordinate of the Z-offset
+
|-
| game        = Vice City, San Andreas
+
| '''Parameter 2''': || || Float (X-offset in units)
| native      = [[GET_OFFSET_FROM_OBJECT_IN_WORLD_COORDS]]
+
|-
}}
+
| '''Parameter 3''': || || Float (Y-offset in units)
If you set the X, Y, and Z offsets to 0.0, it is better to use opcode [[01BB]] instead since you are getting the object's own position. Note that the parameters are mixed around.
+
|-
 +
| '''Parameter 4''': || || Float (Z-offset in units)
 +
|-
 +
| '''Parameter 5''': || || Variable to store the X-coordinate of the X-offset
 +
|-
 +
| '''Parameter 6''': || || Variable to store the Y-coordinate of the Y-offset
 +
|-
 +
| '''Parameter 7''': || || Variable to store the Z-coordinate of the Z-offset
 +
|}'''Supports''': [[GTA 3]], [[Vice City]], [[San Andreas]], [[Liberty City Stories]] (0405), [[Vice City Stories]] (0279)<br>'''Analogous to GTA IV''': [[GET_OFFSET_FROM_OBJECT_IN_WORLD_COORDS]]<br>
 +
In GTA III, this opcode saves the time stat for Multistorey Mayhem. In Vice City and San Andreas, this stores coordinates offset from the object's position. If you set the X, Y, and Z offsets to 0.0, it is better to use opcode [[01BB]] instead since you are getting the object's own position. Note that the parameters are mixed around.
 
[[Sanny Builder]] example:<source lang="scm">0400: store_coords_to 4@ 5@ 6@ from_object 0@ with_offset 1@ 2@ 3@</source>
 
[[Sanny Builder]] example:<source lang="scm">0400: store_coords_to 4@ 5@ 6@ from_object 0@ with_offset 1@ 2@ 3@</source>
  
Line 22: Line 31:
 
==Keywords==
 
==Keywords==
 
get, store, object, position, location, offset
 
get, store, object, position, location, offset
 +
 +
[[Category:OpCodes]]

Revision as of 09:48, 18 March 2010

0400=1,%1d%
0400=7,%5d% %6d% %7d% %1d% %2d% %3d% %4d%
Description: Gets the offset of the object's position

GTA III Vice City San Andreas Liberty City Stories Vice City Stories
Parameter 1 Integer value  Existing object handle
Parameter 2: Float (X-offset in units)
Parameter 3: Float (Y-offset in units)
Parameter 4: Float (Z-offset in units)
Parameter 5: Variable to store the X-coordinate of the X-offset
Parameter 6: Variable to store the Y-coordinate of the Y-offset
Parameter 7: Variable to store the Z-coordinate of the Z-offset

Supports: GTA 3, Vice City, San Andreas, Liberty City Stories (0405), Vice City Stories (0279)
Analogous to GTA IV: GET_OFFSET_FROM_OBJECT_IN_WORLD_COORDS

In GTA III, this opcode saves the time stat for Multistorey Mayhem. In Vice City and San Andreas, this stores coordinates offset from the object's position. If you set the X, Y, and Z offsets to 0.0, it is better to use opcode 01BB instead since you are getting the object's own position. Note that the parameters are mixed around.

Sanny Builder example:

0400: store_coords_to 4@ 5@ 6@ from_object 0@ with_offset 1@ 2@ 3@

Note

The above format is more commonly used. The actual format of this opcode is in order:
0400=7,%1d% %2d% %3d% %4d% %5d% %6d% %7d%
The format to use depends on which INI file you use.

Keywords

get, store, object, position, location, offset