Ai goal assault: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(removed {{DISPLAYTITLE}}, covered by the hl2 point template)
(updates)
Line 1: Line 1:
{{hl2 point|ai_goal_assault}}
{{lang|Ai goal assault}}
{{hl2 point|ai_goal_assault}} 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.


==Entity description==
Upon activation, the entity will round up all its actors (specified in a keyvalue), and instruct them to select their {{ent|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.
This [[entity]] specifies which NPCs are to carry out an [[Assaults|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 its ''actors'' 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 the assault cue (specified in the ''AssaultCue'' keyvalue), unless instructed ''Don't wait for a cue.''.
Upon the cue, it will then instruct all actors to begin moving on from their current rally point to the {{ent|assault_assaultpoint}} specified by the rally point.


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.
{{code class|CAI_AssaultGoal|ai_behavior_assault.cpp}}


==Keyvalues==
==Keyvalues==
{{KV Targetname}}
{{KV|Actor(s) to affect (actor)|target_name_or_class|NPCs that will perform this assault. This field supports wildcards, if they are needed.}}
{{KV|Rally Point Set (rallypoint)|target_destination|The name of the <code>assault_rallypoint</code>(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.}}


{{KV|Actor(s) to affect|target_name_or_class|NPCs that should perform this assault. This field supports wildcards, if they are needed.{{note|Each NPC needs its own rally point, so if you use wildcards for this field, you should also use wildcards for the '''rallypoint'''.}}
{{note|Each NPC needs its own rally point. You can still probably get away with naming all your rally points the same thing.}}
}}


{{KV|Rally Point Set|target_destination|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.}}
{{KV|Search Type (SearchType)|choices|How '''Actor(s) to affect''' finds NPCs to include in the assault.
 
:*0: Entity Name ([[targetname]])
{{KV|Search Type|choices|How to search for the entities using the name specified in the ''actorname'' keyvalue. The ''Entity Name'' choice will make the engine search for a ''targetname'' of an entity, while the ''Classname'' choice will make it search for the name of an entity class (like ''npc_headcrab'').}}
:*1: [[Classname]]}}
:* 0 : Entity Name
{{KV|Start Active (StartActive)|bool|Should this goal be active when the map begins?}}
:* 1 : Classname
{{KV|Assault Cue (AssaultCue)|choices|Chooses when the goal is going to be set after this entity has been activated.
 
:*1: Entity System Input (<code>BeginAssault</code>)
{{KV|Start Active|bool|Should this goal be active when the map begins?}}
:*2: Gunfire (When the entity 'hears' gunfire {{todo|Tested with player weapons and [[ai_sound]], no results.}})
 
:*2: Don't wait for a cue. (Attack immediately after rallying finishes)}}
{{KV|Assault Cue|choices|Chooses when the goal is going to be set after this entity has been activated.}}
{{KV|Rally Point Selection Method (RallySelectMethod)|choices|Select the Rally Point Selection Method.
:{| class=standard-table
*0: Priority number assigned to each <code>assault_rallypoint</code>. If there are multiple tied for priority, go to the closest one.
! Literal Value || Description || Cue...
*1: Choose randomly}}
|-
{{KV BaseEntity|base=1}}
| 1 || Entity System Input ||After it has received a ''BeginAssault'' input through the [[Inputs and Outputs|I/O system]].
|-
| 2 || Gunfire ||When the entity 'hears' gunfire.
|-
| 3 || Don't wait for a cue. ||Immediately after being activated.
|}
 
{{KV|Rally Point Selection Method|choices|Select the Rally Point Selection Method.}}
*'''0''': Priority number assigned to each assault_rallypoint. If there are multiple tied for priority, go to the closest one.
*'''1''': Choose randomly
 
<!--This entity doesn't have any flags.-->


==Inputs==
==Inputs==
{{I Targetname}}
{{IO|Activate|If the entity is not yet active, this input will activate it.}}
{{IO|Activate|If the entity is not yet active, this input will activate it.}}
 
{{IO|Deactivate|Deactivates the assault. NPCs are released from the assault behavior and control is relinquished back to the standard AI/other triggers, as desired by the level designer.}}
{{IO|Deactivate|Deactivates the assault. NPCs are released from the assault behaviour and control is relinquished back to the standard AI/other triggers, as desired by the level designer.}}
{{IO|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.}}}}
 
{{I BaseEntity|base=1}}
{{IO|BeginAssault|IIf the entity is active and this entity's ''Assault Cue'' keyvalue is set to ''Entity System Input'', begin the assault(s).{{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.}}}}


==Outputs==
==Outputs==
{{O Targetname}}
{{O BaseEntity}}


==See also==
==See also==
* [[Assaults]] - The assault system explained.
*[[npc_metrocop_assault]] and [[npc_soldier_assault]] - Two [[prefabs]] containing complete setups of a mass assault of metrocops and soldiers respectively.
* [[npc_metrocop_assault]] and [[npc_soldier_assault]] - Two prefabs containing complete setups of a mass assault of metrocops and soldiers respectively.


[[Category:AI]] [[Category:Entities]]
[[Category:AI]]

Revision as of 23:56, 1 September 2018

English (en)Translate (Translate)

Template:Hl2 point 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.

C++ In code, it is represented by theCAI_AssaultGoalclass, defined in theai_behavior_assault.cppfile.

Keyvalues

Actor(s) to affect (actor) ([todo internal name (i)]) <target_name_or_class>
NPCs that will perform this assault. This field supports wildcards, if they are needed.
Rally Point Set (rallypoint) ([todo internal name (i)]) <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.pngNote:Each NPC needs its own rally point. You can still probably get away with naming all your rally points the same thing.


Search Type (SearchType) ([todo internal name (i)]) <choices>
How Actor(s) to affect finds NPCs to include in the assault.
Start Active (StartActive) ([todo internal name (i)]) <boolean>
Should this goal be active when the map begins?
Assault Cue (AssaultCue) ([todo internal name (i)]) <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.
    )
  • 2: Don't wait for a cue. (Attack immediately after rallying finishes)
Rally Point Selection Method (RallySelectMethod) ([todo internal name (i)]) <choices>
Select the Rally Point Selection Method.
  • 0: Priority number assigned to each assault_rallypoint. If there are multiple tied for priority, go to the closest one.
  • 1: Choose randomly


Inputs

Activate
If the entity is not yet active, this input will activate it.
Deactivate
Deactivates the assault. NPCs are released from the assault behavior and control is relinquished back to the standard AI/other triggers, as desired by the level designer.
BeginAssault
If the entity is active and this entity's Assault Cue keyvalue is set to Entity System Input, begin the assault.
Tip.pngTip:This will cause NPCs to "skip over" the rally point if they aren't there already. Useful for using rally points for selecting actors.


Outputs

See also