Difference between revisions of "02CE"

From GTAMods Wiki
Jump to navigation Jump to search
(load collision)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{OpCode
 
{{OpCode
| ini        = 02CE=4,%4d% %1d% %2d% %3d%
+
| games      = {{Icon|t}}
| description = Gets the height of the ground beneath the coordinate
+
| command    = GET_GROUND_Z_FOR_3D_COORD
| p1          = X-coordinate
+
| description = Gets the height of the ground beneath the coordinates point
| p2          = Y-coordinate
+
| syntax1    = 02CE: [''var''] = ground_z [''flt1''] [''flt2''] [''flt3'']
| p3          = Z-coordinate
+
| p1t        = [''flt1'']
| p4          = Variable to store height of ground
+
| p1d        = X-coordinate
| game        = GTA3, Vice City, San Andreas
+
| p2t        = [''flt2'']
 +
| p2d        = Y-coordinate
 +
| p3t        = [''flt3'']
 +
| p3d        = Z-coordinate
 +
| p4t        = [''var'']
 +
| p4d        = Variable to store the height of the ground, a floating-point value
 
| native      = [[GET_GROUND_Z_FOR_3D_COORD]]
 
| native      = [[GET_GROUND_Z_FOR_3D_COORD]]
 
}}
 
}}
This opcode can store the height in the Z-axis of the ground below a specific point in the game. If there is no solid ground below that point, the height would be considered as 0. The ground has to have a [[collision model]]. Note that the fourth parameter is placed in the beginning instead of at the end.
 
[[Sanny Builder]] example:<source lang="scm">02CE: 3@ = ground_z_at 0@ 1@ 2@</source>
 
  
==Note==
+
This opcode gets the height in the z-axis of the ground below the specified coordinates point. There is a ground if there is a [[Collision File|collision]] loaded beneath the point. If there is no solid ground below the point, the height would return ''0.0''. For Vice City and San Andreas, if you want to guarantee that the collision at the point is loaded, use opcode [[04E4]] followed by [[038B]] to force the loading of the collision and then immediately retrieve the ground z.
The above format is more commonly used. The actual format of this opcode is in order:<br>
 
<code>02CE=4,%1d% %2d% %3d% %4d%</code><br>
 
The format to use depends on which INI file you use.
 
  
==Keywords==
+
== Keywords ==
 
get, store, ground, height
 
get, store, ground, height
 
[[Category:OpCodes]]
 

Latest revision as of 04:35, 25 November 2016

GTA III Vice City San Andreas GET_GROUND_Z_FOR_3D_COORD


Description
Gets the height of the ground beneath the coordinates point
Syntax
02CE: [var] = ground_z [flt1] [flt2] [flt3]
Parameter
[flt1]
X-coordinate
[flt2]
Y-coordinate
[flt3]
Z-coordinate
[var]
Variable to store the height of the ground, a floating-point value
Native analog
GET_GROUND_Z_FOR_3D_COORD

This opcode gets the height in the z-axis of the ground below the specified coordinates point. There is a ground if there is a collision loaded beneath the point. If there is no solid ground below the point, the height would return 0.0. For Vice City and San Andreas, if you want to guarantee that the collision at the point is loaded, use opcode 04E4 followed by 038B to force the loading of the collision and then immediately retrieve the ground z.

Keywords

get, store, ground, height