20.04.2012, 18:44
(
Последний раз редактировалось RyDeR`; 17.05.2012 в 08:38.
)
Introduction
This is a basic implementation of the dijkstra algorithm, including a basic example of a GPS system working on nodes, using this include.
Function(s)
We have only one basic function:
Here's how the node array should look like:
If the link is invalid you have to use -1. See usage in the example filterscript.
Example
In the link below, there's a basic GPS system using this pathfinding include. The nodes included are complete LV nodes and were made by me a while ago. I will do the whole San Andreas world once I have some free time and when I feel like it. I don't recommend using the default San Andreas nodes from NODESX.DAT with this include as there are too much to calculate in a reasonable time.
[ame]http://www.youtube.com/watch?v=rENx33otwE4[/ame]
GPS.pwn
Download
Dijkstra.inc
This is a basic implementation of the dijkstra algorithm, including a basic example of a GPS system working on nodes, using this include.
Function(s)
We have only one basic function:
pawn Код:
stock Dijkstra(const aeNodes[][], iStart, iEnd, aiPath[], const iSize = sizeof(aeNodes))
pawn Код:
enum e_Nodes {
Float: e_fNX,
Float: e_fNY,
Float: e_fNZ,
e_iLink1,
e_iLink2,
e_iLink3,
e_iLink4
};
Example
In the link below, there's a basic GPS system using this pathfinding include. The nodes included are complete LV nodes and were made by me a while ago. I will do the whole San Andreas world once I have some free time and when I feel like it. I don't recommend using the default San Andreas nodes from NODESX.DAT with this include as there are too much to calculate in a reasonable time.
[ame]http://www.youtube.com/watch?v=rENx33otwE4[/ame]
GPS.pwn
Download
Dijkstra.inc