ai_goal_assault
class hierarchy |
---|
CAI_AssaultGoal defined in ai_behavior_assault.cpp
|
ai_goal_assault
is a point entity available in all Source games.
This entity specifies which NPCs are to carry out an assault, and triggers it when any conditions given are met. One goal can handle multiple rally points. Must be active to be able to be triggered.
Upon activation, the entity will round up all its actors (specified in a keyvalue), and instruct them to select their assault_rallypoint
(s) and move to it/them. Upon arrival at the rally point(s), each actor then begins waiting for an Assault Cue, unless instructed to assault immediately.
Upon the cue, it will then instruct all actors to begin moving on from their current rally point to the assault_assaultpoint
specified by the rally point.
Keyvalues
- Name
(targetname)
<string> - The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Rally Point Set
(rallypoint)
<targetname> - The name of the
assault_rallypoint
(s) at which this assault will begin. This field can also support wildcards, so that you can enter the root name of all rally points for this assault followed by an asterisk '*', to match all with the same root.
Note:Each NPC needs its own rally point. You can still probably get away with naming all your rally points the same thing.
- Assault Cue
(AssaultCue)
<choices> - Chooses when the goal is going to be set after this entity has been activated.
- 1: Entity System Input (
BeginAssault
) - 2: Gunfire (When the entity 'hears' gunfire) Todo: Tested with player weapons and ai_sound, no results.
- 3: Don't wait for a cue. (Attack immediately after rallying finishes)
- 1: Entity System Input (
- Rally Point Selection Method
(RallySelectMethod)
<choices> - How NPCs will decide which rallypoint to move to.
- For games before Alien Swarm (including 2013 SDK):
- 0: Choose by priority. If there are multiple tied for priority, go to the closest one.
- 1: Choose randomly
- 2: If priority is tied, go to the point farthest away.Template:AS add
- Branch Method
(BranchMethod)
<integer> (in all games since ) !FGD - Confirm:Default (0) tells NPCs to pick randomly if they come across multiple
assault_assaultpoint
s they can use. 1 makes NPCs pick whichever is closest to them.
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
BeginAssault
- If the entity is active and this entity's Assault Cue keyvalue is set to Entity System Input, begin the assault. Tip:This will cause NPCs to "skip over" the rally point if they aren't there already. Useful for using rally points for selecting 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]
See also
- npc_metrocop_assault and npc_soldier_assault - Two prefabs containing complete setups of a mass assault of metrocops and soldiers respectively.