Ai goal actbusy: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎See Also: argh..)
(Merged info from Actbusy.)
Line 2: Line 2:


==Entity Description==
==Entity Description==
{{todo|Move the description from [[Actbusy]], perhaps?}}
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:
 
The first is to fire the ''Activate'' input on the ai_goal_actbusy entity, which will cause it to start ordering the NPCs under its command to act busy.
 
The second is to leave the ai_goal_actbusy inactive, and send it ''ForceNPCToActBusy'' inputs to order specific NPCs under its command to act busy. 


==Keyvalues==
==Keyvalues==
* {{kv targetname}}
* {{kv targetname}}
* '''actor'''
* '''actor'''
: <target_name_or_class> Actor(s) to affect - NPC's that should act busy.
: <target_name_or_class> Actor(s) to affect - The targetname or classname of any NPCs that is to act busy. Wildcards are supported.
* '''StartActive'''
* '''StartActive'''
: <choices> Start Active
: <boolean> Start Active
* '''SearchType'''
* '''SearchType'''
: <choices> Search Type - How to search for the entities using the targetname.
: <choices> Search Type - What type of targetname the ''actor'' keyvalue is refering to.
:{|
!Literal value!!Description
|-
| 0 || Entity Name
|-
| 1 || Classname
|}
* '''busysearchrange'''
* '''busysearchrange'''
: <float> Search Range for Busy Hints
: <float> Search Range for Busy Hints - Maximum distance between an actbusy hint and NPC for the NPC to consider it.
* '''visibleonly'''
* '''visibleonly'''
: <choices> Visible Busy Hints Only
: <boolean> Visible Busy Hints Only - 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.
<!--All these keyvalues should be templated. They all occur in [[ai_goal_actbusyqueue]] too.--->
<!--All these keyvalues should be templated. They all occur in [[ai_goal_actbusyqueue]] too.--->
<!--This entity has no flags.--->
<!--This entity has no flags.--->
==Inputs==
==Inputs==
*{{i targetname}}
*{{i targetname}}
*'''Activate'''
*'''Activate'''
: Begin acting busy.
: Begin acting busy. Begins ordering NPCs to actbusy.
*'''Deactivate'''
*'''Deactivate'''
: Cease acting busy.
: Cease acting busy. Ends ordering NPCs to actbusy. They will remain busy until they decide to move, at which point they will return to normal behavior.
*'''ForceNPCToActBusy''' ''<Targetname> <hint node targetname> <optional:teleport> <optional:$customactivityorsequence> <maximum time to actbusy>''
*'''ForceNPCToActBusy'''
: Force an NPC to act busy. 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.
: Takes the following optional parameters, separated by spaces:
*'''ForceThisNPCToActBusy''' ''<string>''
: <targetname> <optional:hint node targetname> <optional:teleport> <optional:nearest> <optional:$customactivityorsequence> <optional:max time>
: Force an NPC outputted from another entity to act busy. Only usable from an output that specifies an entity.
: Force an NPC to act busy.
*'''ForceThisNPCToLeave''' ''<string>''
:The ''targetname'' parameter specifies the name of the NPC(s).
: Force an NPC outputted from another entity to find a HINT_NPC_EXIT_POINT hintnode and vanish.
: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.
*'''SetBusySearchRange''' ''<float>''
:If the ''teleport'' keyword is specified as a parameter, the NPC will teleport onto the actbusy node instead of navigating to it.
: Update the busy search range for all actors.
: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 optional ''$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. <code>$ACT_RUN</code> will make the NPC(s) run to the node. Sequence names can be used instead of activities.
*'''ForceThisNPCToActBusy'''
: <string> Force a parameter-specified NPC (outputted from another entity) to act busy. Only usable from an output that specifies an entity, as a connection for outputs of other entities that pass along the NPC. The most common usage of this is to connect the ''OnSpawnNPC'' output of an [[npc_maker]] to this input, since the ''OnSpawnNPC'' output contains the spawned NPC in the parameter. If there are multiple NPCs with the same name, only ''one'' will be ordered.
*'''ForceThisNPCToLeave'''
: <string> Force a parameter-specified NPC (outputted from another entity) to find an ''NPC exit point'' (HINT_NPC_EXIT_POINT hintnode) and vanish. Supports wildcards.
 
 
*'''SetBusySearchRange'''
: <float> Alters the '''busysearchrange''' keyvalue for all actors.


==Outputs==
==Outputs==
*'''OnNPCFinishedBusy''' ''<string>''
*'''OnNPCFinishedBusy'''
: Fired when an NPC targeted by this goal finishes an ActBusy.
: <string> Fired when an NPC targeted by this goal finishes an ActBusy animation sequence.
*'''OnNPCLeft''' ''<string>''
*'''OnNPCLeft'''
: Fired when an NPC target by this goal finishes a forced Leave.
: <string> Fired when an NPC targeted by this goal, ordered by the '''ForceThisNPCToLeave''' input, finishes its forced leave.
*'''OnNPCStartedBusy''' ''<string>''
*'''OnNPCStartedBusy'''
: Fired when an NPC targeted by this goal starts an ActBusy animation.
: <string> Fired when an NPC targeted by this goal starts an ActBusy animation sequence.
* {{o targetname}}
* {{o targetname}}



Revision as of 22:27, 5 April 2006

Template:Wrongtitle

Entity Description

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:

The first is to fire the Activate input on the ai_goal_actbusy entity, which will cause it to start ordering the NPCs under its command to act busy.

The second is to leave the ai_goal_actbusy inactive, and send it ForceNPCToActBusy inputs to order specific NPCs under its command to act busy.

Keyvalues

<target_name_or_class> Actor(s) to affect - The targetname or classname of any NPCs that is to act busy. Wildcards are supported.
  • StartActive
<boolean> Start Active
  • SearchType
<choices> Search Type - What type of targetname the actor keyvalue is refering to.
Literal value Description
0 Entity Name
1 Classname
  • busysearchrange
<float> Search Range for Busy Hints - Maximum distance between an actbusy hint and NPC for the NPC to consider it.
  • visibleonly
<boolean> Visible Busy Hints Only - 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.

Inputs

Begin acting busy. Begins ordering NPCs to actbusy.
  • Deactivate
Cease acting busy. Ends ordering NPCs to actbusy. They will remain busy until they decide to move, at which point they will return to normal behavior.
  • ForceNPCToActBusy
Takes the following optional parameters, separated by spaces:
<targetname> <optional:hint node targetname> <optional:teleport> <optional:nearest> <optional:$customactivityorsequence> <optional: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 optional $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
<string> Force a parameter-specified NPC (outputted from another entity) to act busy. Only usable from an output that specifies an entity, as a connection for outputs of other entities that pass along the NPC. The most common usage of this is to connect the OnSpawnNPC output of an npc_maker to this input, since the OnSpawnNPC output contains the spawned NPC in the parameter. If there are multiple NPCs with the same name, only one will be ordered.
  • ForceThisNPCToLeave
<string> Force a parameter-specified NPC (outputted from another entity) to find an NPC exit point (HINT_NPC_EXIT_POINT hintnode) and vanish. Supports wildcards.


  • SetBusySearchRange
<float> Alters the busysearchrange keyvalue for all actors.

Outputs

  • OnNPCFinishedBusy
<string> Fired when an NPC targeted by this goal finishes an ActBusy animation sequence.
  • OnNPCLeft
<string> Fired when an NPC targeted by this goal, ordered by the ForceThisNPCToLeave input, finishes its forced leave.
  • OnNPCStartedBusy
<string> Fired when an NPC targeted by this goal starts an ActBusy animation sequence.

See Also