(08-14-2011, 10:53 PM)Your Computer Wrote: (08-14-2011, 10:30 PM)Kyle Wrote: They go in the order you set them in. In a function, it will do the first path node that is set up for the monster and then work it's way down the function following the order. If they went in a random order, there would be no easy way to set a monster up with path nodes.
It should be noted that when adding a patrol node with AddEnemyPatrolNode(), you do not need to specify every single pathnode in the map. For example, let's say the user has 5 pathnodes in the map lined up in a straight line. In the script, he would only have to add the first and fifth pathnode with AddEnemyPatrolNode(). The AI would know what to do from there.
To extend this a bit, it's not a bad idea to fill all of the area that a monster might traverse with a node grid. Most might never be used, but when monsters "investigate" a sound, they attempt to path to the node nearest the place that the sound was heard. If none are nearby, the monster doesn't go anywhere unless the area is in direct LOS. If the player puts stuff in the intended path, the monster will get stuck without a grid of alternate paths to take, so make sure all walkable floorspace that the monster might need to go to (such as every room the player could hide in) has a node grid above it.