Waypoints  by JJ86 6/27/04


 

Waypoints are a way of making actors walk around on the map in a realistic way. Anything from patrols walking around a raider camp, to a citizen going about their daily chores can be done with waypoints.

In the editor each waypoint is marked with an entity. Each waypoint in the path must have the same player index (Normally 0) and the same tag name. The waypoint entity can be found in the Misc directory.

There are two kinds of waypoint, "waypoint" and "waypoint_dir"

Waypoint_Dir will make the entity face in the direction indicated when they reach that point.

Ordered Waypoints

Ordered waypoints are a list where the actor knows to walk from point A to point B in a certain order. Each of the waypoints has an Index, starting at 0 for the first point in the path. When an actor reaches a waypoint they check against the Next Waypoint list to find where to go next. Normally ordered waypoints are in a loop, so that an actor walks from index 0, to index 1, to index 2, etc… eventually ending up back at index 0, where they start the path again.

It is possible to give a list of next waypoints that the actor can pick from, instead of a single index. In the Next Waypoint list field just provide it a list of different index numbers, each seperated by a comma. This is good for creating a random wandering pattern, while maintaining some form of order.

For example: At waypoint 3 the next index is set to 4,5,6 which means that an actor who walks to waypoint 3 will next goto either waypoint 4, 5 or 6.

It is possible to weight which waypoint will be selected next by putting the more waypoints you prefer the actor to goto in multiple times, for example:

3,3,3,3,4 will give an actor a 80% chance of going to waypoint 3, and a 20% chance of going to waypoint 4.

If a waypoint specifies either -1 or a blank for the next waypoint, then actors will stop when they reach it.

 

Actions at Waypoints

It is possible to cause actors to perform special actions at each waypoint they reach.

Pause will cause the actors to wait for a specified amount of time before moving onto the next waypoint. The time is measured in seconds.

Action allows you to force an actor to perform an animation at the waypoint. You can use this to make it look like a character is checking things, opperating machines or computers, or any other number of tasks. The actor will perform the animation once.

Repeat Action will make the actor perform the action you specified for the entire time it is at the waypoint. Good for patrols who get to the gates of the town and spend 30 seconds looking around, or similar tasks.