CAI_FollowGoal
Jump to navigation
Jump to search
Code classes:
CAI_FollowGoal
CAI_GoalEntity
(AI goals)CBaseEntity
(all ents)
CAI_FollowGoal
is a code class that makes NPCs follow another object or the player at a configurable distance. NPCs may react in some way if they can't path to their leader.
Classnames:
ai_goal_follow
Note: NPCs do not intelligently follow their leader. They will simply walk or run directly towards it. If the followers happen to block a path, they will not move out of the way and the leading NPC will eventually give up trying to path. (Depends on Formation.)
ConVars/Commands[edit | edit source]
ConVar/Command | Parameters or default value | Parameter Type | Effect |
---|---|---|---|
ai_debug_follow | 0 | 0 disables, 1 enables | Tells when an NPC is having trouble following their leader. Requires developer 1 in the console before taking effect. Seems non-functional? |
Keyvalues[edit | edit source]
- Target Entity
(goal)
<target_destination>
- The name of the entity to follow. If blank, defaults to the player.
- Formation
(Formation)
<choices>
- How close to the target the NPCs should follow. Each has somewhat different behavior.
- 0: Close circle
- 1: Wide circle
- 2: Antlion (Not in FGD) - For antlions following the player.
- 3: Commander (Not in FGD) - For citizens following the player.
- 4: Tight (Not in FGD)
- 5: Medium circle
- 6: Sidekick
- 7: Hunter (Not in FGD) - For hunters following striders.
- 8: Vortigaunt
- 9: Top-Down Tight (Not in FGD) (available in all games since ) - Unknown.
- Maximum State
(MaximumState)
<choices>
- Maximum alertness level for NPCs to continue following? Keyvalue does not appear in code.
Inputs[edit | edit source]
- OutsideTransition (Not in FGD) (only available in Episodic)
- Sends the entity into a dormant state where it is disabled even though the entity may still think it is active. This isn't intended to be done by the mapper, so the only way to bring it out of this state would be to transition out and into the map again. Normally this input is automatically sent by a
trigger_changelevel
when the map gets changed.