Difference between revisions of "PATH"

From GTAMods Wiki
Jump to navigation Jump to search
(Tools and scripts)
(standardized page)
Line 1: Line 1:
{{IplSection}}
+
{{IplSection
[[Paths]] in [[Vice City]] are grouped into nodes, each with at most 12 sub-nodes. The group nodes define the type of vehicle going to be used by the sub nodes. Sub nodes contain path coordinates which are linked to each other. There are two kinds of links:
+
| game        = [[GTA VC]]
 +
| description = Used to define paths for traffic
 +
}}
 +
'''PATH''' is a section in the [[item placement]] file. It is used to define paths for traffic. Paths are grouped into nodes, each with at most 12 sub-nodes. The group nodes define the type of vehicle going to be used by the sub nodes. Sub nodes contain path coordinates which are linked to each other. There are two kinds of links:
 
* internal links – connecting nodes within the same group.
 
* internal links – connecting nodes within the same group.
 
* external links – connecting nodes over two different groups.
 
* external links – connecting nodes over two different groups.
  
== Description of the Vice City paths system ==
+
== Format ==
First of all, consider a small segment of the line in a group node. The group node has to be defined and then there are the 12 sub-nodes inside it. The number of coordinates vary from 2 to 12. If the number of coordinates does not reach 12, then they are filled with null nodes which does not do anything just to make the group node hold always 12 nodes. The internal and external sub nodes are defined each with a special attribute in it. The internal sub nodes are the middle parts of a segment of the line, while the external sub nodes are the end points of the segment of the line. They are used to connect to other external sub-node or end point of another segment (another group) of the line. To connect the external sub-nodes or end points, they must and always must have the same coordinates. All the other group nodes link up together using this concept, thus you get a path which a vehicle or a ped follows from the beginning and to the end of the line.
+
<pre<includeonly></includeonly> style="overflow-x: auto;">
Spawns are made in the external nodes (always remember that fact) and then they follow the route of the line.
+
path
 +
Object, -1
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
 +
end
 +
</pre>
  
One can add a maximum of 24 group nodes in Vice City though this limit can be increased by Maxorator's Path hacks. {{ref|1}}
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 
+
! style="width: 3em;"| {{Icon|VC}}
==Flags==
+
! style="width: 12em;"| Identifier
The last three numbers at the end of a paths line are the Flags, each ones can define a special function.
+
! style="width: 6em;" | Type
 
+
! Description
'''Flag 1, Node Speed Limit'''
+
|-
 
+
! colspan="4" | Group
Flag 1 has been identified as a Speed function. It specifies the speed of NPC Vehicles travelling in the node
+
|-
{| {{Prettytable}}
+
| A || Object || integer ||
|0 || Slow Vehicle Speed
+
* 0 = Pedestrian traffic
 +
* 1 = Road traffic
 +
* 2 = Water traffic
 +
|-
 +
| B || -1 || integer || always -1, used as a delimiter
 +
|-
 +
! colspan="4" | Node
 +
|-
 +
| A || NodeType || integer ||
 +
* 0 = Null
 +
* 1 = External
 +
* 2 = Internal
 +
|-
 +
| B || NextNode || integer ||
 +
* -1 = Do not link to any other node in this group
 +
* 0 to 11 = Link to this node number in this group
 +
|-
 +
| C || IsCrossRoad || integer || Boolean determining if there is a cross road in the imaginary line joined by two nodes
 +
|-
 +
| D,E,F || X, Y, Z || float[3] || X, Y, Z coordinates of the node
 +
|-
 +
| G || Median || float ||
 +
* Pedestrian traffic: width of walkway
 +
* Road traffic: width of divider between left and right lanes
 
|-
 
|-
|1 || Average Vehicle Speed
+
| H || LeftLanes || integer || Number of lanes left of the node
 
|-
 
|-
|2 || Fast Vehicle Speed
+
| I || RightLanes || integer || Number of lanes right of the node
|}
 
'''''Note:''' I (Swoorup) believe that the maximum value for this speed limit is 3 since its storage is limited to 2 bits''
 
 
 
 
 
'''Flag 2, Vehicle Travel/Roadblock'''
 
 
 
Flag 2 has been identified as a controller for where some vehicle can travel and where Police Roadblock will spawn.
 
 
 
'''''Note:''' Police Roadblock will only work if it is a Vehicle node with that Flag.''
 
 
 
'''''Note:''' Specified Vehicles Only, means that only Vehicles with a Specified flag will use the Paths.''
 
 
 
{| {{Prettytable}}
 
|0 || No flags
 
 
|-
 
|-
|1 || Node Ignored By Traffic
+
| J || SpeedLimit || integer || Sets the speed of vehicles traveling through the path
 +
* 0 = Slow
 +
* 1 = Average
 +
* 2 = Fast
 +
* 3 may be possible
 
|-
 
|-
|2 || Police Roadblock Spawns
+
| K || Flags || integer || General node behavior
 +
* 0 = No flags
 +
* 1 = Ignored by traffic
 +
* 2 = Police roadblock (only for road traffic node)
 +
* 4 = Restricted node
 +
* 8 = No effect, used by water traffic
 
|-
 
|-
|4 || Restricted Node
+
| L || SpawnRate || float || Spawn rate frequency ranging from 0.0 to 1.0
 
|}
 
|}
  
'''''Note:''' Although 8 seems to be used in most of the boat paths, it does not do anything and its function is same as that of setting the flag to 0''
+
== Description ==
 +
First of all, consider a small segment of the line in a group node. The group node has to be defined and then there are the 12 sub-nodes inside it. The number of coordinates vary from 2 to 12. If the number of coordinates does not reach 12, then they are filled with null nodes which does not do anything just to make the group node hold always 12 nodes. The internal and external sub nodes are defined each with a special attribute in it. The internal sub nodes are the middle parts of a segment of the line, while the external sub nodes are the end points of the segment of the line. They are used to connect to other external sub-node or end point of another segment (another group) of the line. To connect the external sub-nodes or end points, they must and always must have the same coordinates. All the other group nodes link up together using this concept, thus you get a path which a vehicle or a ped follows from the beginning and to the end of the line.
 +
Spawns are made in the external nodes (always remember that fact) and then they follow the route of the line.
  
'''Flag 3, Spawn Rate'''
+
One can add a maximum of 24 group nodes in Vice City though this limit can be increased by Maxorator's Path hacks. {{ref|1}}
 
 
Flag 3 is supposably used to control the Spawn rate of Vehicles on that path but people have not noticed a difference.
 
The spawn frequency can range from 0.0 to 1.0
 
 
 
Setup of a VC Paths Line
 
<source lang="cpp"> iNodeType, iNextNode, bIsCrossRoad, fX, fY, fZ, fMedian, dwLeftLanes, dwRightLanes, dwSpeedLimit, dwFlags, fSpawnRate </source>
 
 
 
'''''Note: ''' bIsCrossRoad is a boolean value which denotes if there is a cross road in the imaginary line joined by two nodes.
 
 
 
''
 
  
 
== Tools and scripts ==
 
== Tools and scripts ==

Revision as of 05:51, 5 August 2015

PATH (IPL section)
Short description:Used to define paths for traffic
Supported games:GTA VC
IPL Sections:
2DFX AUZO BLOK CARS CULL ENEX GRGE
INST JUMP LINK LODM MLO+ MULT OCCL
PATH PICK RTFX SLOW TCYC VNOD ZONE

PATH is a section in the item placement file. It is used to define paths for traffic. Paths are grouped into nodes, each with at most 12 sub-nodes. The group nodes define the type of vehicle going to be used by the sub nodes. Sub nodes contain path coordinates which are linked to each other. There are two kinds of links:

  • internal links – connecting nodes within the same group.
  • external links – connecting nodes over two different groups.

Format

path
Object, -1
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
	NodeType, NextNode, IsCrossRoad, X, Y, Z, Median, LeftLanes, RightLanes, SpeedLimit, Flags, SpawnRate
end
Vice City Identifier Type Description
Group
A Object integer
  • 0 = Pedestrian traffic
  • 1 = Road traffic
  • 2 = Water traffic
B -1 integer always -1, used as a delimiter
Node
A NodeType integer
  • 0 = Null
  • 1 = External
  • 2 = Internal
B NextNode integer
  • -1 = Do not link to any other node in this group
  • 0 to 11 = Link to this node number in this group
C IsCrossRoad integer Boolean determining if there is a cross road in the imaginary line joined by two nodes
D,E,F X, Y, Z float[3] X, Y, Z coordinates of the node
G Median float
  • Pedestrian traffic: width of walkway
  • Road traffic: width of divider between left and right lanes
H LeftLanes integer Number of lanes left of the node
I RightLanes integer Number of lanes right of the node
J SpeedLimit integer Sets the speed of vehicles traveling through the path
  • 0 = Slow
  • 1 = Average
  • 2 = Fast
  • 3 may be possible
K Flags integer General node behavior
  • 0 = No flags
  • 1 = Ignored by traffic
  • 2 = Police roadblock (only for road traffic node)
  • 4 = Restricted node
  • 8 = No effect, used by water traffic
L SpawnRate float Spawn rate frequency ranging from 0.0 to 1.0

Description

First of all, consider a small segment of the line in a group node. The group node has to be defined and then there are the 12 sub-nodes inside it. The number of coordinates vary from 2 to 12. If the number of coordinates does not reach 12, then they are filled with null nodes which does not do anything just to make the group node hold always 12 nodes. The internal and external sub nodes are defined each with a special attribute in it. The internal sub nodes are the middle parts of a segment of the line, while the external sub nodes are the end points of the segment of the line. They are used to connect to other external sub-node or end point of another segment (another group) of the line. To connect the external sub-nodes or end points, they must and always must have the same coordinates. All the other group nodes link up together using this concept, thus you get a path which a vehicle or a ped follows from the beginning and to the end of the line. Spawns are made in the external nodes (always remember that fact) and then they follow the route of the line.

One can add a maximum of 24 group nodes in Vice City though this limit can be increased by Maxorator's Path hacks. [1]

Tools and scripts

External links