Pathfind::getClosestVehicleNode: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(mp.game v2 compatibility)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{ClientSide}}
FYI: When falling through the map (or however you got under it) you will respawn when your player ped's height is &lt;= -200.0 meters (I think you all know this) and when in a vehicle you will actually respawn at the closest vehicle node.<br><br>----------<br><br>Vector3 nodePos;<br>GET_CLOSEST_VEHICLE_NODE(x,y,z,&amp;nodePos,...)<br><br>p4 is either 0, 1 or 8. 1 means any path/road. 0 means node in the middle of the closest main (asphalt) road.<br>p5, p6 are always the same:<br>0x40400000 (3.0), 0<br>p5 can also be 100.0 and p6 can be 2.5:<br>PATHFIND::GET_CLOSEST_VEHICLE_NODE(a_0, &amp;v_5, v_9, 100.0, 2.5)<br><br>Known node types: simple path/asphalt road, only asphalt road, water, under the map at always the same coords. <br><br>The node types follows a pattern. For example, every fourth node is of the type water i.e. 3, 7, 11, 15, 19, 23, 27, 31, 35, 39... 239. Could not see any difference between nodes within certain types. <br>Starting at 2, every fourth node is under the map, always same coords.<br>Same with only asphalt road (0, 4, 8, etc) and simple path/asphalt road (1, 5, 9, etc). <br><br>gtaforums.com/topic/843561-pathfind-node-types
FYI: When falling through the map (or however you got under it) you will respawn when your player ped's height is &lt;= -200.0 meters (I think you all know this) and when in a vehicle you will actually respawn at the closest vehicle node.<br><br>----------<br><br>Vector3 nodePos;<br>GET_CLOSEST_VEHICLE_NODE(x,y,z,&amp;nodePos,...)<br><br>p4 is either 0, 1 or 8. 1 means any path/road. 0 means node in the middle of the closest main (asphalt) road.<br>p5, p6 are always the same:<br>0x40400000 (3.0), 0<br>p5 can also be 100.0 and p6 can be 2.5:<br>PATHFIND::GET_CLOSEST_VEHICLE_NODE(a_0, &amp;v_5, v_9, 100.0, 2.5)<br><br>Known node types: simple path/asphalt road, only asphalt road, water, under the map at always the same coords. <br><br>The node types follows a pattern. For example, every fourth node is of the type water i.e. 3, 7, 11, 15, 19, 23, 27, 31, 35, 39... 239. Could not see any difference between nodes within certain types. <br>Starting at 2, every fourth node is under the map, always same coords.<br>Same with only asphalt road (0, 4, 8, etc) and simple path/asphalt road (1, 5, 9, etc). <br><br>gtaforums.com/topic/843561-pathfind-node-types
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">pathfind.getClosestVehicleNode(x, y, z, outPosition, nodeType, p5, p6);</syntaxhighlight>
{{JSContainer|
<syntaxhighlight lang="javascript">mp.game.pathfind.getClosestVehicleNode(x, y, z, nodeType, p5, p6);</syntaxhighlight>
}}
=== Required Arguments ===
=== Required Arguments ===
*'''x:''' float
*'''x:''' float
*'''y:''' float
*'''y:''' float
*'''z:''' float
*'''z:''' float
*'''outPosition:''' Vector3
*'''nodeType:''' int
*'''nodeType:''' int
*'''p5:''' float
*'''p5:''' float
Line 14: Line 17:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
// todo
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Pathfind_function_c}}
{{Pathfind_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 02:08, 17 September 2021

Client-Side

FYI: When falling through the map (or however you got under it) you will respawn when your player ped's height is <= -200.0 meters (I think you all know this) and when in a vehicle you will actually respawn at the closest vehicle node.

----------

Vector3 nodePos;
GET_CLOSEST_VEHICLE_NODE(x,y,z,&nodePos,...)

p4 is either 0, 1 or 8. 1 means any path/road. 0 means node in the middle of the closest main (asphalt) road.
p5, p6 are always the same:
0x40400000 (3.0), 0
p5 can also be 100.0 and p6 can be 2.5:
PATHFIND::GET_CLOSEST_VEHICLE_NODE(a_0, &v_5, v_9, 100.0, 2.5)

Known node types: simple path/asphalt road, only asphalt road, water, under the map at always the same coords.

The node types follows a pattern. For example, every fourth node is of the type water i.e. 3, 7, 11, 15, 19, 23, 27, 31, 35, 39... 239. Could not see any difference between nodes within certain types.
Starting at 2, every fourth node is under the map, always same coords.
Same with only asphalt road (0, 4, 8, etc) and simple path/asphalt road (1, 5, 9, etc).

gtaforums.com/topic/843561-pathfind-node-types

Syntax

JavaScript Syntax

mp.game.pathfind.getClosestVehicleNode(x, y, z, nodeType, p5, p6);


Required Arguments

  • x: float
  • y: float
  • z: float
  • nodeType: int
  • p5: float
  • p6: float

Return value

  • Vector3

Example

// todo

See also

Template:Pathfind s function c