Ai goal lead

From Valve Developer Community

Table of 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

Defines the name that other entities refer to this entity by.
  • hammerid [Episode Two Update]
<integer readonly> This id is used for debugging purposes in Hammer.
Specifies the targetname of this entity's Parent in a movement hierarchy. Child entities 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 [Episode One Update]
<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 [Episode One Update]
<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 [Episode One Update]
<boolean> Before Coming Back, Wait for speech?
  • RetrieveWaitForSpeak [Episode One Update]
<boolean> On Retrieve, Wait for speech?
  • DontSpeakStart [Episode One Update]
<boolean> Speak start greeting?
  • LeadDuringCombat [Episode One Update]
<boolean> Lead during combat?
  • GagLeader [Episode One Update]
<boolean> Gag Leader?
  • ComingBackConceptModifier [Episode One Update]
<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 [Episode One Update]
<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

  • Kill
Removes this entity from the world.
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 == infinite)>
Causes this entity's OnUser1-4 outputs to be fired. See User Inputs and Outputs.
Changes the entity's parent in the movement hierarchy.
Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. The entity will maintain it's position relative to the Parent's Origin and Angles at the time it is attached.
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

Fired in response to FireUser1-4 inputs. See User Inputs and Outputs.
!activator = activator
  • 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)