What is this?
With the pathfinding system you are able to create Waypoints for units which they need to follow in a particular order. The units can attack nearby enemies if you want to, which will halt the unit's progress towards the next waypoint for a limited amount of time. The unit will proceed moving towards this waypoint when:
No enemy units are present within the unit's Aggro Range;
The unit hasn't attacked an enemy unit over a certain period of time. This is called the Response Time or Accuracy.
Effects
This download includes the following effects:
Pathfinding - Set Unit Alive
This effect marks the unit as alive or dead. Dead units are ignored by the pathfinding system.
Parameters
Source Unit: The unit with pathfinding.
Alive (true/false): Marks the unit as alive or dead.
Pathfinding - Add Unit
This effect adds an unit to the pathfinding system. Dead units are ignored by the pathfinding system.
Parameters
Source Unit: The unit with pathfinding.
Patrols (true/false): Marks if the unit needs to patrol on the waypoints.
Route ABCA (true/false): Determines if the unit needs to follow the route in ABCA order (true) or ABCBA order (false).
Attack Move: The unit will attack enemy units on sight if enabled.
Waypoint radius: Determines how close the unit needs to get to a waypoint before he can proceed towards the next one.
Aggro range: Sets unit's aggro range in meters.
Return after attack (true/false): Determines if the unit will return to the location he launched the attack from or if he will immediately proceed towards the next waypoint after having attacked an enemy unit.
Pathfinding - Create Waypoints
This effect creates waypoints that plan out a route.
Parameters
New Waypoints (true/false): Is this a new route?
Waypoints Name: The route name.
Waypoint 1-5: Set the waypoints to your liking.
Pathfinding - Bind Waypoints To Unit
This effect binds a route to the unit that he will start to follow.
Parameters
Source Unit: The unit with pathfinding.
Waypoints Name: The route name.
Pathfinding - Start
This effect handles all unit movement commands.
Parameters
Accuracy: Determines how long a unit needs to wait before he continues to move towards the next waypoint after having given up a fight.
yPathfinding - Add Unit, yPathfinding - Set Unit Alive, yPathfinding - Bind Waypoints To Unit
These effects are exactly the same as their counterparts, only the Source Unit parameters are replaced with Quest Var parameters. The quest vars are used by the ytriggers to temporarily store unit ids. The unit ids are used to select units with the corresponding unit id so that unit commands can be invoked for that unit.
IMPORTANT: You need the ytriggers to be able to use these three effects, which can be downloaded right here.
You also need the Activate Trigger Loader effect which you can download right here. Make sure to create a trigger with the condition always and this effect before you start using any of the pathfinding effects!
Installation & Use
To install these effects, simply put the Pathfinding.xml file into your trigger2 folder. This download also includes two simple scenarios which demonstrate how to use the effects. The Pathfinding v2 scenario demonstrates how to use the effects to create a pathfinding system for units that are already placed on the editor map and the Pathfinding v3 Army Deploy scenario demonstrates how to do this for units that aren't already placed on the editor map.
Do you have any questions?
Ask them in the Pathfinding topic on the forums!