Flee (Procedure)

From the CreationKit Wiki
Jump to navigation Jump to search

Behavior

Description:
Makes an actor run away from a target (or toward a location) while acting in a frantic manner -- playing lines of dialogue and animations that indicate panic. It is effectively two separate but closely-related procedures ("FleeFrom" and "FleeTo") bound into one.

The procedure completes:
???

Parameters

  • FleeFrom (Target): Specifies the target from which to flee. NOTE: this is ignored (in favor of the FleeTo parameter) if UseDynamicGoalInstead is false.
  • FleeTo (Location): Specifies a fixed location from which to flee. NOTE: this is ignored (in favor of the FleeFrom parameter) if UseDynamicGoalInstead is true.
  • UseDynamicGoalInstead (Bool): If true, we use FleeFrom and ignore FleeTo. If false, we use FleeTo and ignore FleeFrom.
  • GoalRadius (Float): This applies only if we're doing a FleeTo. We use this as the goal radius for the destination. (This makes it easier to use a Ref or ObjectList as a destination. If the destination is actually a Location, its radius will be ignored in favor of this radius.)
  • AvoidNodeRadius (Float): This applies regardless of whether we're doing a FleeFrom and FleeTo. This is how far the path planner tries to keep the path from all threat(s). This doesn't matter too much in the usual case (where we are running directly away from all threats) but sometimes the only way to get far enough from all threats is to run "toward" (but still around) one or more of them. Even in a single-threat situation, we might be caught in a dead-end alley or a room with only one door; in such cases the only way to get far enough from the threat might be to run toward it, but we still want the path to keep at least this far away from it.
  • FleeDist (Float): If we're doing a FleeFrom, procedure is complete when the actor is at least this distance away from all threats.
  • RideHorseIfPossible (Bool): If true, and if the actor has been assigned a horse (via data on his ref) then the actor will mount that horse prior to fleeing. Additional conditions might eventually be added to the definition of "if possible" (e.g. "if the horse is nearby" perhaps).
  • ForgetDeadThreats (Bool): Don't run away from things that are dead. (Usually true)
  • Quiet (Bool): If true, don't say "flee dialogue" lines.
  • CountAsIsFleeing (Bool): Treat actor as if actually fleeing (as in combat), which prevents the player from being able to activate the actor.

                   

Notes

  • Does this procedure have a defined ending?
    • Yes. It depends on the value of UseDynamicGoalInstead.
      • If UseDynamicGoalInstead is true, it ends successfully when the actor is either at least FleeDist units away from the FleeFrom target(s), or when there are no more FleeFrom targets (due to being dead/disabled/etc.).
      • If UseDynamicGoalInstead is false, it ends successfully when the actor is withing GoalDist units of the FleeTo target.
  • How does this procedure deal with multiple targets?
    • If an ObjectList is passed into the FleeFrom parameter, the actor will be aware of all targets in the list as threats, and will continue fleeing until each threat is farther than FleeDist away.

See Also

  • ??? None.