Ai goal actbusy queue
From Valve Developer Community
| Table of contents |
[edit]
Entity description
Behaves the same way as an ai_goal_actbusy entity does, except that an ai_goal_actbusy_queue orders actbusy hints and NPCs in a queue. The queue can be moved forward, and when the first NPC in the queue leaves, it can be given orders.
Note: Actbusy hints not specified in the keyvalues will function as normal, as will NPCs who cannot join the queue.
Warning: Hint activities should not require exiting, or the queue will freeze.[edit]
Keyvalues
- targetname <target_source>
- 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.
- actor
- <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.
- node_exit
- <target_destination> Exit Node - The name of the first node (info_node_hint or path_corner) the first NPC in the queue should head to when leaving the queue. Required.
- node01-20
- <target_destination> Node 1-20 - The name of the nth actbusy hint node in the queue. (Node 1 is the front of the queue.) The number of defined nodes defines the maximum number of NPCs queuing.
- mustreachfront
- <choices> Must Reach Front - If true, an NPC must strictly be at Node 1 before being able to leave the queue.
[edit]
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.
- Activate
- Begin acting busy. Begins ordering NPCs to actbusy.
- Deactivate
- Cease acting busy. Ends ordering NPCs to actbusy. They will remain busy until they decide/are ordered to move, at which point they will return to normal behavior.
- ForceNPCToActBusy <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_RUNwill make the NPC(s) run to the node. Sequence names can be used instead of activities.
- ForceThisNPCToActBusy <ehandle>
- 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 <ehandle>
- 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.
- MoveQueueUp
- Moves all NPCs in the queue up one position, and sends the first NPC to the Exit Node.
- PlayerStartedBlocking <float>
- Tell the queue manager that the player has started blocking the point in the queue passed as a parameter.
- PlayerStoppedBlocking <float>
- Tell the queue manager that the player has stopped blocking the point in the queue passed as a parameter.
[edit]
Outputs
- Fired in response to FireUser1-4 inputs. See User Inputs and Outputs.
- !activator = activator
- OnNPCStartedBusy <ehandle>
- Fired when an NPC targeted by this goal starts an ActBusy animation sequence.
- OnNPCFinishedBusy <ehandle>
- Fired when an NPC targeted by this goal finishes an ActBusy animation sequence.
- OnNPCLeft <ehandle>
- Fired when an NPC targeted by this goal, ordered by the ForceThisNPCToLeave input, finishes its forced leave.
- OnNPCStartedLeavingQueue <ehandle>
- Fired when the NPC at the head of the queue starts to leave. The activator is the NPC, and the ehandle is the NPC.
- OnNPCLeftQueue <ehandle>
- Fired when the NPC at the head of the queue leaves and has reached the Exit Node. The activator is the NPC, and the ehandle is the NPC.
- OnQueueMoved <float>
- Fired when the queue moves. Outputs the number of NPCs remaining in the queue.
[edit]
See also
- Actbusy Queues - description of the Actbusy queue system.
Categories: Entities | AI
