Follow (Procedure)
Revision as of 11:16, 9 November 2011 by imported>Henning (moved Procedure Follow to Follow (Procedure))
Behavior
Description:
Allows an actor to follow another actor or the player until the package is no longer valid.
- Follower runs toward target until within max distance.
- Follower tries to keep pace with target.
- Actors following the player will sprint, under two circumstances:
- If the player is sprinting.
- If they are more than fFollowStartSprintDistance units from the player (initially set to 300).
The procedure completes:
Procedure does not end unless conditionalized out, or paired with a procedure that ends in a simultaneous branch.
Parameters
- Target (Target): Specifies an actor to follow.
- MinRadius (Float): Specifies the closest that the following actor should be to the target. If too close, the follower will not walk.
- MaxRadius (Float): Specifies the furthest that the following actor should be from the target. If too far away, the follower will begin running.
- GoToLeadersGoal (Bool): If following an NPC, will try to walk toward it, simulating an approximation of "walking with" rather than "following behind."
- RideHorseIfPossible (Bool): If true, will ride a horse if possible.
- NeedLOS (Bool): If true, actor will only follow if has Line of Sight to the target.
Notes
- What if the follow target dies, or is dead?
- The procedure should be considered invalid and does not run.
- Does the follower try to just stay within the MaxDistance, or is there some sweet spot that they look for?
- There is a sweet spot, but mostly it’s about trying to match the leader’s speed.
- Does the follower try to move at the same speed as the target, or do they begin running after the target if they're too far away?
- Yes on both counts.
- Does the follower sneak if the target is sneaking?
- Yes
- Is the calculated distance between follower and target a raw GetDistance check, or some sort of distance derived from pathing between the two? (i.e. Will the follower be ok if the target is just on the other side of a wall?)
- Once pathing code can supply a pathing distance again, a follower should use this method rather than a raw distance check.
See Also
{{{SeeAlso}}}