Ai goal follow: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 11: Line 11:


==Keyvalues==
==Keyvalues==
* {{KV Targetname}}
{{ScrollBox|title=Keyvalues|
* '''actor'''
{{KV Targetname}}
: <target_name_or_class> The name of the NPCs that will be following.
 
* '''goal'''
{{KV|Actor(s) to affect|target_name_or_class|The name of the NPCs that will be following.}}
: <string> The name of the entity that the NPCs should follow.
 
:* If this value is blank, NPCs will follow the player if they are friendly towards him
{{KV|Target Entity|string|The name of the entity that the NPCs should follow.
* '''SearchType'''
:* If this value is blank, NPCs will follow the player if they are friendly towards him.}}
: <choices> How to search for the entities using the actor.
 
:{| class=standard-table
{{KV|Search Type|choices|How to search for the entities using the name specified in the ''actorname'' keyvalue. The ''Entity Name'' choice will make the engine search for a ''targetname'' of an entity, while the ''Classname'' choice will make it search for the name of an entity class (like ''npc_headcrab'').}}
! Literal Value || Description
:* 0 : Entity Name
|-
:* 1 : Classname
| 0 || Entity name
 
|-
{{KV|Start Active|bool|Should this entity be active when the map begins?}}
| 1 || Classname
 
|}
{{KV|Maximum State|choices|The maximum state for NPCs to continue following.}}
* '''StartActive'''
:* 0 : Idle
: {{boolean}}
:* 1 : Alert
* '''MaximumState'''
:* 2 : Combat
: <choices> The maximum state for NPCs to continue following.
 
:{| class=standard-table
{{KV|Formation|choices|How close to the target the NPCs should follow.}}
! Literal Value || Description
:* 0 : Close circle
|-
:* 1 : Medium Circle
| 0 || Idle
:* 2 : Wide circle
|-
:* 3 : Sidekick
| 1 || Alert
:* 4 : Vortigaunt
|-
}}
| 2 || Combat
|}
* '''Formation'''
: <choices> How close to the target the NPCs should follow.
:{| class=standard-table
! Literal Value || Description
|-
| 0 || Close circle
|-
| 5 || Medium Circle
|-
| 1 || Wide circle
|-
| {{EP1 add|6}} || {{EP1 add|Sidekick}}
|}


==Inputs==
==Inputs==
* {{I Targetname}}
{{I Targetname}}
* '''Activate'''
 
: Begin the follow behavior
{{IO|Activate|Begin the follow behavior.}}
* '''Deactivate'''
 
: Cease the following behavior
{{IO|Deactivate|Cease the following behavior.}}


==Outputs==
==Outputs==
* {{O Targetname}}
{{O Targetname}}


[[Category:AI]]
[[Category:AI]]
[[Category:Entities]]
[[Category:Entities]]

Revision as of 04:26, 4 February 2012

Template:Hl2 point

Entity description

Ai goal follow.png

Makes the target NPCs follow another object or the player at a configurable distance.

Limitations and bugs

  • NPCs do not intelligently follow their target. They will instead walk or run depending on distance directly towards it.
  • If NPCs are following another NPC and that NPC needs to get past them, they will not move out of the way and the leading NPC will eventually give up.
  • Keyvalues cannot be changed once the map has been compiled.

Keyvalues

Keyvalues:
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities


Actor(s) to affect ([todo internal name (i)]) <target_name_or_class>
The name of the NPCs that will be following.


Target Entity ([todo internal name (i)]) <string>
The name of the entity that the NPCs should follow.
  • If this value is blank, NPCs will follow the player if they are friendly towards him.


Search Type ([todo internal name (i)]) <choices>
How to search for the entities using the name specified in the actorname keyvalue. The Entity Name choice will make the engine search for a targetname of an entity, while the Classname choice will make it search for the name of an entity class (like npc_headcrab).
  • 0 : Entity Name
  • 1 : Classname


Start Active ([todo internal name (i)]) <boolean>
Should this entity be active when the map begins?


Maximum State ([todo internal name (i)]) <choices>
The maximum state for NPCs to continue following.
  • 0 : Idle
  • 1 : Alert
  • 2 : Combat


Formation ([todo internal name (i)]) <choices>
How close to the target the NPCs should follow.
  • 0 : Close circle
  • 1 : Medium Circle
  • 2 : Wide circle
  • 3 : Sidekick
  • 4 : Vortigaunt

Inputs

Activate
Begin the follow behavior.


Deactivate
Cease the following behavior.

Outputs