CAI_FollowGoal

From Source Entities
Jump to navigation Jump to search

Present in:
Css.pngCS:S
Dods.pngDOD:S
Hl2.pngHL2
Hl2-episodes.pngEp1&2
Hl2dm-custom.pngHL2:DM
P1.pngPortal
Tf2.pngTF2
Asw.pngASW
P2.pngPortal 2
Csgo.pngCS:GO

Code classes:

Ai goal follow.png

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/CommandParameters or default valueParameter TypeEffect
ai_debug_follow00 disables, 1 enablesTells 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.
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 Hl2.pngEpisodicP1.png)
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.