Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Pathinding (I'm so smart)

Author
Message
flibX0r
21
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 12th Jul 2003 11:10 Edited at: 13th Jul 2003 09:33
Oki, heres the source...

Editor:


Just replace modelname.x with the name of the model you want to use as a guide to model.
Controls:
- w, s, a, d to move the selected node
- [ and ] to change the selected node
- , and . to change the radius of the node (for calculating what node your player is on
- q and e toggle the node existance
- 1, 2, 3 and 4 let you set the node links
- Enter saves the data as pathnodes.node
- L loads pathnodes.node
Note: for the moment, you cannot have seperate node areas, meaning all nodes must be able to get every other node via links and other nodes.


The big function:


Globals needed for FindPath()


Just put this and the LoadPathNodes() Function in yer game and run the function. It will return 1 if it finds the path (almost always). The pathfinding node data is stored in PathBank (which is an array).

Please reply if yo have any troubles

EDIT: Fixed post, it did some weird s***

"Time not important only life important...
I have no life so time is irrelevent..."
Twin P4 Xeon 2.0 Ghz, GeForce Quadro4 XGL 128MB, 1Gb DDR RAM, Twin 19" Flat Screens

Login to post a reply

Server time is: 2024-11-24 02:35:53
Your offset time is: 2024-11-24 02:35:53