Path Nodes
originally written by Springheel
For more information on pathfinding, see Pathfinding.
Path entities (or path nodes) are the things that you use to make your AI move around the map. Placing path nodes can take a little getting used to; hopefully this article will help (I'm far from an expert, but here's what I've discovered so far).
There are lots of different kinds of path nodes. It can sometimes help to think of them as "travel nodes" (nodes that AI will travel to) and "behaviour nodes" (nodes that tell AI how to behave at a certain point).
Although path nodes have a directional arrow in the editor, it does not appear to do anything. It has no effect on what direction AI face.
You must use the keyword "target" to tell AI what pathnode they should go to (or act on) next. If you type "target" "path_corner_1" in your AI property list, then your AI will walk to "path_corner_1". Without a "target" property, your AI will not go anywhere. Once you add a "target" property to either your AI or another node, you should see an orange line connecting the two entities.
path_corner
Probably the most common path node, this is a "travel node". AI will walk from their current position to this node. This node must be on the ground and in an area AI can reach. See Pathfinding for more information on how to help AI go from one node to another.
You can target more than one path_corner; D3 will randomly choose between them. Use the following syntax: (actually this needs to be double checked)
target path_corner_1 target_2 path_corner_2 (At the moment, targetting more than 2 path_corners does not seem to work (possibly a DR bug). You can target more than two behaviour nodes, however)
- path_anim (plays an anim once when the AI gets to this point in space, then goes on to the next path entity when the anim is done playing)
- path_cycleanim (stays in place and loops an anim, either for a specified amount of time or until triggered)
- path_lookat (for the next wait seconds, turn head to look at the entity given by the focus spawnarg (defaults to looking at the path_lookat entity itself). Immediately keep moving to next path_* in sequence.)
- path_turn Turns in place to face a chosen direction. Give it the property angle from 0 to 360 with the direction you wish the player to be facing, eg, as follows in plan (top) view...
- 0 = East (X)
- 90 = North (Y)
- 180 = West (-X)
- 270 = South (-Y)
- 360 = East(X)
It might also default to facing the path_turn entity itself. Try also focus with an entity name to get it to face that entity (not tried)
- path_wait ( waits, standing completely motionless at a given place for a given amount of time, then moves to next path_* ) - (tested OK - Fidcal)
- path_waitfortrigger ( waits at a given place until triggered, then moves to next path_* )
- path_hide (deactivates and stops rendering the AI)
- path_show (starts rendering the AI)
- path_attack (Used to script AI attacking a particular enemy, for scripted sequences I guess. AI will continue on to the next path entity if it kills the enemy)
- path_interact This lets the AI interact with an entity (for example a button) in a similar way to frobbing. This will only work for buttons etc, but not for inventory items and moevables. The AI will stop and look at the entiy while interacting, but not walk to it, so a path_corner next to the entity is required.