CAI_ActBusyGoal

From Source Entities
Jump to navigation Jump to search

Present in:
Hl2.pngHL2
Hl2-episodes.pngEp1&2
Hl2dm-custom.pngHL2:DM
P1.pngPortal
Asw.pngASW
P2.pngPortal 2

Code classes:

CAI_ActBusyGoal is a code class for entities that make NPCs act busy.

Classnames:

  • ai_goal_actbusy

ConVars/Commands[edit | edit source]

ConVar/CommandParameters or default valueParameter TypeEffect
ai_actbusy_search_time10SecondsTo do: Effect description.
ai_debug_actbusy01-5Used to debug actbusy behavior. Usage:
  1. Constantly draw lines from NPCs to the actbusy nodes they've chosen to actbusy at.
  2. Whenever an NPC makes a decision to use an actbusy, show which actbusy they've chosen.
  3. Selected NPCs (with npc_select) will report why they're not choosing actbusy nodes.
  4. Display debug output of actbusy logic.
  5. Display safe zone volumes and info.

Keyvalues[edit | edit source]

Search Range for Busy Hints (busysearchrange) <float>
Maximum distance between an actbusy hint and NPC for the NPC to consider it.
Visible Busy Hints Only (visibleonly) <boolean>
If set, an NPC will only consider actbusy hints in view when deciding which to use. Once the choice has been made it will not change, even if new hints become visible.
Actbusy Type (type) <choices>
Is this Actbusy part of combat? For use with Combat Safe Zone.
  • 0: Default (non-combat)
  • 1: Combat
Allow actor to teleport? (allowteleport) <boolean>
To do: Description.
Sight Entity (seeentity) <target_destination>
Optionally, if the Actor playing the ActBusy loses sight of this specified entity for an amount of time defined by Sight Entity Timeout, the specified entity will leave the ActBusy.
Sight Entity Timeout (seeentitytimeout) <float>
Time in seconds to wait for an Actor to see the Sight Entity again before the entity may leave the ActBusy.
Sight Enemy Method (sightmethod) <choices>
How to determine if the Actor sees the Sight Entity.
  • 0: Default. LOS -and- Viewcone.
  • 1: LOS Only. Disregard Viewcone.
Combat Safe Zone (safezone) <target_destination>
Specify a brush entity to act as a safe zone if Actbusy Type is set to Combat. If any enemies are in the safe zone, the actbusy will be terminated. To do: Will actors go back to the actbusy once enemies are dead? What if the enemies leave the safe zone but are still alive?

Inputs[edit | edit source]

ForceNPCToActBusy <string>
Format: <targetname> [hint node targetname] [teleport] [nearest] [$<custom activity or sequence>] [max time]
Force an NPC to act busy. Mouse over each parameter for more info.
To do: How is the default time decided?
ForceThisNPCToActBusy <string>
Force a specified NPC to act busy.
ForceThisNPCToLeave <string>
Force an NPC to find an NPC exit point (HINT_NPC_EXIT_POINT hint node) and vanish.
SetBusySearchRange <float>
Alters the Search Range for Busy Hints keyvalue for all actors.

Outputs[edit | edit source]

OnNPCStartedBusy <string>
Fired when an NPC targeted by this entity starts an ActBusy animation sequence. Automatically puts the targetname of the NPC as the input parameter, unless overridden by the mapper.
OnNPCFinishedBusy <string>
Fired when an NPC targeted by this entity finishes an ActBusy animation sequence. Automatically puts the targetname of the NPC as the input parameter, unless overridden by the mapper.
OnNPCLeft <string>
Fired when an NPC targeted by this goal leaves the actbusy for any reason.[Confirm] Automatically puts the targetname of the NPC as the input parameter, unless overridden by the mapper.
OnNPCLostSeeEntity <string>
Fired when the NPC loses sight of the Sight Entity. Automatically puts the targetname of the NPC as the input parameter, unless overridden by the mapper.
Note: The FGD doesn't mention this parameter and seems to not acknowledge it, but the functionality is there in code. The parameter might not fire with the default FGD, and if so the void type should be changed to string.
OnNPCSeeEnemy <string>
Fired when this NPC leaves their ActBusy because they saw an enemy. Automatically puts the targetname of the NPC as the input parameter, unless overridden by the mapper.
Note: The FGD doesn't mention this parameter and seems to not acknowledge it, but the functionality is there in code. The parameter might not fire with the default FGD, and if so the void type should be changed to string.