ai_goal_lead
From Valve Developer Community
Contents |
Entity description
When activated by a trigger, makes an NPC attempt to lead the player to a target. Optionally, a point can be set for the NPC to wait for the player before beginning to lead the player.For examples of its use, see the Half-Life 2 maps:
- d1_town_02
- d1_town_02a
- d2_coast_03
- d2_coast_10
- d2_coast_11
- d2_prison_06
- d2_prison_07
- d3_c17_09
- d3_c17_10b
For more examples of its use, see the Half-Life 2: Lost Coast map: d2_lostcoast
- See also: Vmex for decompiling maps.
The ConceptModifier keyvalues do not appear to be utilized by any of the maps above, but appear to provide some level of access to the NPC Response System.
Keyvalues
-
Targetname:
- Name <string>
- The targetname other entities refer to this entity by.
-
Parentname:
- Parent
<targetname> - Specifies the targetname of this entity's movement parent. Entities with parents move with their parent.
- actor
- <target_name_or_class> Actor(s) to affect
- goal
- <target_destination> Target Entity
- WaitPointName
- <target_destination> Point to wait at if the target's not visible.
- WaitDistance
- <float> Wait until player gets this close.
- LeadDistance
- <float> The player is considered to be lagging if he's beyond this distance.
- Run
- <boolean> Run instead of walk
- Retrieve
- <boolean> Retrieve player?
- AttractPlayerConceptModifier
- <string> Attract player concept modifier
- WaitOverConceptModifier
- <string> Player wait over concept modifier
- ArrivalConceptModifier
- <string> Arrival concept modifier
- PostArrivalConceptModifier
- <string> Post-arrival concept modifier
- SuccessConceptModifier
- <string> Success concept modifier
- FailureConceptModifier
- <string> Failure concept modifier
- RetrieveDistance
- <float> The distance from the player that the NPC should return to when retrieving a lagging player. Must be between ('Lead Distance' + 24) and ('Lead Distance' * 4) to avoid the leader ping-ponging.
- SuccessDistance
- <float> The distance from the player (to the NPC) that the player must be within for the Lead to succeed, once the NPC has reached the goal. If set to 0, it'll use the lead distance instead (for legacy support).
- ComingBackWaitForSpeak
- <boolean> Before Coming Back, Wait for speech?
- RetrieveWaitForSpeak
- <boolean> On Retrieve, Wait for speech?
- DontSpeakStart
- <boolean> Speak start greeting?
- LeadDuringCombat
- <boolean> Lead during combat?
- GagLeader
- <boolean> Gag Leader?
- ComingBackConceptModifier
- <string> Appended to the keyvalues passed into the response rules when the 'TLK_LEAD_RETRIEVE' concept is spoken. Spoken as the NPC starts returning to the player to retrieve him.
- RetrieveConceptModifier
- <string> Appended to the keyvalues passed into the response rules when the 'TLK_LEAD_COMINGBACK' concept is spoken. Spoken when NPC has finally reached the player to retrieve him.
- SearchType
- <choices> How to search for the entities using the actor.
Literal Value Description 0 Entity name 1 Classname
Flags
- 1 : No def success
- 2 : No def failure
- 4 : Use goal facing
Inputs
-
Targetname:
-
Kill - Removes this entity from the world.
-
KillHierarchy - Removes this entity and all its children from the world.
-
AddOutput <string> - Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
- Format:
<key> <value> - Format:
<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite> -
FireUser1toFireUser4 - Fire the
OnUseroutputs; see User Inputs and Outputs.
-
Parentname:
-
SetParent <targetname> - Move with this entity. See Entity Hierarchy (parenting).
-
SetParentAttachment <string> - Attach to a named attachment on the current parent. The entity will teleport so that the position of its root bone matches that of the attachment.
-
SetParentAttachmentMaintainOffset <string> - As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
-
ClearParent - Removes this entity from its current movement hierarchy.
- Activate
- Begin the leading behavior
- Deactivate
- Stop the leading behavior
- SetSuccess
- Notify success of leading
- SetFailure
- Notify failure of leading
Outputs
-
Targetname:
-
OnUser1toOnUser4 - Fired in response to the
FireUserinputs; see User Inputs and Outputs. -
OnKilled(New with Left 4 Dead) - Fired when the entity is killed and removed from the game.
- OnArrival
- Fires when NPC reaches the lead point
- OnArrivalDone
- Fires when NPC has played out any arrival speech
- OnSuccess
- Fires when NPC achieves the goal
- OnFailure
- Fires when NPC fails to achieve the goal
- OnDone
- Fires when NPC completes behavior (any post-success or fail acting is complete)

