ID:1350656
 
(See the best response by Magnum2k.)
Problem description:
I'm trying to create navigation nodes that my NPCs travel by, a lot like how Valve's Source Engine uses info_nodes to tell NPCs where they can walk.
I don't know what the best way is but I know one way.

----
1. Create a node object that can be placed on the map. Give it an icon if you want, so that you can see them in the map editor. Give them three variables, locX,locY,locZ.

2. Edit the world.New() proc to loop through all the nodes in existence. They should all be on the map and have x,y,z values. For each node I'd put their x,y,z values into locX,locY,locZ respectively. Once that was done I'd add them to a global list of nodes, removing them from the map.

3. I'd use walk_towards(src,location) and get the location for that function from the global list of nodes which are basically saved locations.
----

You could have them randomly walk between nodes or walk towards the nearest node they haven't been to already by saving the nodes they've walked to. If they've been to every node that's near them, clear the list of saved nodes and add where they're currently at.

That's one way I'd do it. I'm sure the moment I post someone will come up with a better way.
It seems to me that this would produce the same outcome of telling them to travel to point xyz on the map. I'm talking about a way to give them better routes so they don't try running into walls.
Best response
I suggest checking out DarkCampainger's MapPaths.
In response to GamerMania
Yeah, if you place them well on the map and use walk_toward()'s path finding it'd work for not getting them stuck.