Ai goal actbusy: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(-added class hierarchy, cleanup)
 
(43 intermediate revisions by 15 users not shown)
Line 1: Line 1:
ai_goal_actbusy
{{LanguageBar}}
{{CD|CAI_ActBusyGoal|file1=ai_behavior_actbusy.cpp}}
{{This is a|point entity|name=ai_goal_actbusy|game=Half-Life 2|game1=Alien Swarm}}


AI Goal Act Busy
This [[entity]] points to a set of [[NPC]]s to control, and contains options about how it should go about making those NPCs [[Actbusy|act busy]]. There are two common methods of using <code>ai_goal_actbusy</code> entities:
#Use <code>Activate</code> to order NPCs under the entity's command to act busy.
#Leave the <code>ai_goal_actbusy</code> inactive, and send it <code>ForceNPCToActBusy</code> inputs to order specific NPCs under its command to act busy.


KEYS
{{stray ent|{{portal}} {{portal2}}}}


Name targetname <target_source> The name that other entities refer to this entity by.
== Games ==
{{confirm}}
# {{hl2|4}}
# {{as|4}}


Actor(s) to affect actor <target_name_or_class> NPC's that should act busy
== Keyvalues ==
{{KV Targetname}}
{{KV BaseActbusyGoal}}
{{KV GoalEntity}}


Start Active StartActive <choices>
== Inputs ==
{{I BaseActbusyGoal}}
{{I GoalEntity}}


Search Type SearchType <choices> How to search for the entities using the targetname.
== Outputs ==
{{O BaseActbusyGoal}}


Search Range for Busy Hints busysearchrange <float>
== See also ==
*{{ent|ai_goal_actbusy_queue}}, A similar entity.


Visible Busy Hints Only visibleonly <choices>
[[Category:AI]]
 
 
INPUTS
 
Kill Removes this entity from the world.
 
KillHierarchy Removes this entity and all its children from the world.
 
AddOutput <string> Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
 
FireUser1 Causes this entity's OnUser1 output to be fired.
 
FireUser2 Causes this entity's OnUser2 output to be fired.
 
FireUser3 Causes this entity's OnUser3 output to be fired.
 
FireUser4 Causes this entity's OnUser4 output to be fired.
 
Activate Begin acting busy
 
Deactivate Cease acting busy
 
SetBusySearchRange <float> Update the busy search range for all actors.
 
ForceNPCToActBusy <string> Force an NPC to act busy. Takes parameters, separated by spaces: <Targetname> <hint node targetname> <optional:teleport> <optional:$customactivityorsequence> <maximum time to actbusy>. If no hint node targetname is specified, it'll search for a random one. If no max time is specified, it'll use the default. Specifying 0 as the max time will make the NPC act busy until disturbed. If the optional teleport parameter is specified, the NPC will teleport to the act busy point. A custom move animation can be specified by prepending $ to the name of it. i.e. $ACT_RUN will make the NPC Run. Sequence names can be used instead of activities.
 
ForceThisNPCToActBusy <string> Force an NPC outputted from another entity to act busy. (only usable from an output that specifies an entity)
 
ForceThisNPCToLeave <string> Force an NPC outputted from another entity to find a HINT_NPC_EXIT_POINT hintnode and vanish.
 
 
OUTPUTS
 
OnUser1 Fired in response to FireUser1 input.
 
OnUser2 Fired in response to FireUser2 input.
 
OnUser3 Fired in response to FireUser3 input.
 
OnUser4 Fired in response to FireUser4 input.
 
OnNPCStartedBusy <string> Fired when an NPC targeted by this goal starts an ActBusy animation.
 
OnNPCFinishedBusy <string> Fired when an NPC targeted by this goal finishes an ActBusy.
 
OnNPCLeft <string> Fired when an NPC target by this goal finishes a forced Leave.

Latest revision as of 09:40, 25 September 2024

English (en)Translate (Translate)
C++ Class hierarchy
CAI_ActBusyGoal
CAI_GoalEntity
CBaseEntity
C++ ai_behavior_actbusy.cpp

ai_goal_actbusy is a point entity available in Half-Life 2 Half-Life 2 and Alien Swarm Alien Swarm.

This entity points to a set of NPCs to control, and contains options about how it should go about making those NPCs act busy. There are two common methods of using ai_goal_actbusy entities:

  1. Use Activate to order NPCs under the entity's command to act busy.
  2. Leave the ai_goal_actbusy inactive, and send it ForceNPCToActBusy inputs to order specific NPCs under its command to act busy.
Note.pngNote:This entity is also in the code for Portal Portal 2. Its functionality is not guaranteed.


Games

[confirm]

  1. Half-Life 2 Half-Life 2
  2. Alien Swarm Alien Swarm

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

AI_ActBusyGoal:

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 (Standard)
  • 1: Combat
Allow actor to teleport? (allowteleport) <boolean>
Sight Entity (seeentity) <targetname>
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.
Note.pngNote:Only targetnames are allowed, not classnames!
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) <targetname>
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 break.
Todo: Will actors go back to the actbusy once enemies are dead? What if they leave the safe zone but are still alive?

AI_GoalEntity:

Actor(s) to affect (actor) <target_name_or_class>
The targetname or classname of any NPCs that will be included in this goal. Wildcards are supported.
Search Type (SearchType) <choices>
What the Actor(s) to affect keyvalue targets by.
  • 0: Entity Name
  • 1: Classname
Start Active (StartActive) <boolean>
Set if goal should be active immediately.

Inputs

AI_ActBusyGoal:

ForceNPCToActBusy <stringRedirectInput/string>
Format: <targetname> [hint node targetname] [teleport] [nearest] [$<custom activity or sequence>] [max time]
Force an NPC to act busy.
  • The targetname parameter specifies the name of the NPC(s).
  • The hint node targetname parameter specifies the name of the Hint node. Used to force an NPC to act busy on a specific node. If no hint node targetname is specified, it'll search for a random one.
  • If the teleport keyword is specified as a parameter, the NPC will teleport onto the actbusy node instead of navigating to it.
  • If the nearest keyword is specified as a parameter, the NPC will choose the nearest valid actbusy node, instead of choosing one randomly from all valid actbusy nodes.
  • The max time parameter specifies the maximum time to actbusy. If no max time is specified, it'll use the default. Specifying 0 as the max time will make the NPC(s) act busy until disturbed.
  • The $customactivityorsequence parameter specifies the name of a custom activity, prepended by a "$", that the NPC(s) will preform while navigating to the node, e.g. $ACT_RUN will make the NPC(s) run to the node. Sequence names can be used instead of activities.
ForceThisNPCToActBusy <targetnameRedirectInput/string>
Force an specified NPC to act busy. If there are multiple NPCs with the same name, only one will be ordered.
ForceThisNPCToLeave <targetnameRedirectInput/string>
Force an NPC to find an NPC exit point (HINT_NPC_EXIT_POINT hintnode) and vanish. Supports wildcards.
SetBusySearchRange <floatRedirectInput/float>
Alters the Search Range for Busy Hints keyvalue for all actors.

AI_GoalEntity:

Activate
Make the goal active if it wasn't already. NPCs will begin taking orders.
Deactivate
Make goal inactive.
UpdateActors  !FGD
Tell the goal entity to re-check Actor(s) to affect in case any disappeared, or any new NPCs spawned.[confirm]

Outputs

AI_ActBusyGoal:

OnNPCStartedBusy <targetname*RedirectOutput/ehandle>
Fired when an NPC targeted by this entity starts an ActBusy animation sequence. This output automatically puts the targetname of the NPC into the parameter box for inputs, if the mapper does not override the parameter with something else.
OnNPCFinishedBusy <targetname*RedirectOutput/ehandle>
Fired when an NPC targeted by this entity finishes an ActBusy animation sequence. This output automatically puts the targetname of the NPC into the parameter box for inputs, if the mapper does not override the parameter with something else.
OnNPCLeft <targetname*RedirectOutput/ehandle>
Fired when an NPC targeted by this goal, ordered by the ForceThisNPCToLeave input, finishes its forced leave. This output automatically puts the targetname of the NPC into the parameter box for inputs, if the mapper does not override the parameter with something else.
OnNPCLostSeeEntity <targetname*RedirectOutput/ehandle>
Fired when the NPC loses sight of the Sight Entity. This output automatically puts the targetname of the NPC into the parameter box for inputs, if the mapper does not override the parameter with something else.
OnNPCSeeEnemy <targetname*RedirectOutput/ehandle>
Fired when this NPC leaves their ActBusy because they saw an enemy. This output automatically puts the targetname of the NPC (that left the actbusy, not the enemy) into the parameter box for inputs, if the mapper does not override the parameter with something else.

See also