Squads: Difference between revisions
ReverendV92 (talk | contribs) m (→Misc) |
Kestrelguy (talk | contribs) m (added language bar.) |
||
Line 1: | Line 1: | ||
Squads allow you to group [[NPC | {{lang|Squads}}{{source topicon}}[[Category:AI]] | ||
Squads allow you to group [[NPC]]s in ways they understand. Members of a squad will cover each other, move together, share information, and take turns at attacking their enemies. However, they have limitations: | |||
* Squads cannot be directly influenced in the regular ways that individual NPCs can be. The mapper can still influence the individual squad members. | * Squads cannot be directly influenced in the regular ways that individual NPCs can be. The mapper can still influence the individual squad members. | ||
* Squads will not stay together if directed otherwise by a scripted or semi-scripted sequence. | * Squads will not stay together if directed otherwise by a scripted or semi-scripted sequence. | ||
* There are no squad leaders, unlike | * There are no squad leaders, unlike in {{Gldsrc|2}}. | ||
* Squad tactics are less complex than in | * Squad tactics are less complex than in Goldsource. | ||
* Squads can contain no more than 16 members. | * Squads can contain no more than 16 members. | ||
* Only two soldiers in a squad can attack at a time, so large squads may be highly ineffective. | * Only two soldiers in a squad can attack at a time, so large squads may be highly ineffective. | ||
Line 9: | Line 10: | ||
To form a squad, edit the <code>Squad Name</code> property for each NPC that will be a part of it. All NPCs sharing the same squad name are in the same squad, no matter their [[PVS]] or location on the map. | To form a squad, edit the <code>Squad Name</code> property for each NPC that will be a part of it. All NPCs sharing the same squad name are in the same squad, no matter their [[PVS]] or location on the map. | ||
==Squad- | ==Squad-Level I/O== | ||
NPCs can be manipulated ''as a squad'' by: | NPCs can be manipulated ''as a squad'' by: | ||
* | * {{ent|ai_battle_line}} | ||
* The <code>wake squad</code> keyvalue of NPCs in the same squad | * The <code>wake squad</code> keyvalue of NPCs in the same squad | ||
An NPC can be added to or removed from a squad at map runtime by its <tt>SetSquad</tt> input. An {{ent|npc_maker}} can also set the squadname of NPCs it spawns, but that squadname cannot be changed at map runtime. | |||
An NPC can be added to or removed from a squad at map runtime by its | |||
The player's squad is special, and has additional relevant [[Inputs and Outputs]]: | The player's squad is special, and has additional relevant [[Inputs and Outputs]]: | ||
* The <code>OnJoinedPlayerSquad</code> and <code>OnLeftPlayerSquad</code> inputs of | * The <code>OnJoinedPlayerSquad</code> and <code>OnLeftPlayerSquad</code> inputs of {{ent|npc_citizen}}s. | ||
* NPCs have an <code>OnDenyCommanderUse</code> input for when they refuse to join the player's squad | * NPCs have an <code>OnDenyCommanderUse</code> input for when they refuse to join the player's squad | ||
* NPCs also have an <code>OnDamagedByPlayerSquad</code> input | * NPCs also have an <code>OnDamagedByPlayerSquad</code> input | ||
* NPCs can be set to auto-join to player's squad with the console command <code>npc_citizen_auto_player_squad</code> | * NPCs can be set to auto-join to player's squad with the console command <code>npc_citizen_auto_player_squad</code> | ||
* The player can manually remove or add NPCs to their squad if the command <code>npc_citizen_auto_player_squad_allow_use</code> is set. This requires <code>npc_citizen_auto_player_squad</code> to be disabled. | * The player can manually remove or add NPCs to their squad if the command <code>npc_citizen_auto_player_squad_allow_use</code> is set. This requires <code>npc_citizen_auto_player_squad</code> to be disabled. | ||
See also the "Player squad transition point" of | See also the "Player squad transition point" of {{ent|info_node_hint}} for taking the player's squad across level transitions. | ||
Some squad I/O is class-specific: | Some squad I/O is class-specific: | ||
* Some Combine NPCs: the <code>LookOn</code> and <code>LookOff</code> inputs can force a Combine NPC to ''only'' see through its squadmates' eyes | * Some Combine NPCs: the <code>LookOn</code> and <code>LookOff</code> inputs can force a Combine NPC to ''only'' see through its squadmates' eyes | ||
* | * {{ent|npc_spotlight}}: the <code>SquadDetectedEnemy</code> output fires when its squad finds an enemy (useful for shining at that enemy) and a corresponding <code>SquadLostEnemy</code> output. | ||
==Misc== | ==Misc== | ||
* The player's squad is <code>player_squad</code>. | * The player's squad is <code>player_squad</code>. | ||
* | * {{ent|npc_citizen}} NPCs have a spawnflag to place them in the player's squad on spawn: <code>65536</code>. | ||
[[ | ==See Also== | ||
*{{ent|ai_battle_line}} | |||
*[[Assaults]] | |||
*[[Standoffs]] |
Revision as of 14:01, 26 May 2022
Squads allow you to group NPCs in ways they understand. Members of a squad will cover each other, move together, share information, and take turns at attacking their enemies. However, they have limitations:
- Squads cannot be directly influenced in the regular ways that individual NPCs can be. The mapper can still influence the individual squad members.
- Squads will not stay together if directed otherwise by a scripted or semi-scripted sequence.
- There are no squad leaders, unlike in
GoldSrc.
- Squad tactics are less complex than in Goldsource.
- Squads can contain no more than 16 members.
- Only two soldiers in a squad can attack at a time, so large squads may be highly ineffective.
To form a squad, edit the Squad Name
property for each NPC that will be a part of it. All NPCs sharing the same squad name are in the same squad, no matter their PVS or location on the map.
Squad-Level I/O
NPCs can be manipulated as a squad by:
- ai_battle_line
- The
wake squad
keyvalue of NPCs in the same squad
An NPC can be added to or removed from a squad at map runtime by its SetSquad input. An npc_maker can also set the squadname of NPCs it spawns, but that squadname cannot be changed at map runtime.
The player's squad is special, and has additional relevant Inputs and Outputs:
- The
OnJoinedPlayerSquad
andOnLeftPlayerSquad
inputs of npc_citizens. - NPCs have an
OnDenyCommanderUse
input for when they refuse to join the player's squad - NPCs also have an
OnDamagedByPlayerSquad
input - NPCs can be set to auto-join to player's squad with the console command
npc_citizen_auto_player_squad
- The player can manually remove or add NPCs to their squad if the command
npc_citizen_auto_player_squad_allow_use
is set. This requiresnpc_citizen_auto_player_squad
to be disabled.
See also the "Player squad transition point" of info_node_hint for taking the player's squad across level transitions.
Some squad I/O is class-specific:
- Some Combine NPCs: the
LookOn
andLookOff
inputs can force a Combine NPC to only see through its squadmates' eyes - npc_spotlight: the
SquadDetectedEnemy
output fires when its squad finds an enemy (useful for shining at that enemy) and a correspondingSquadLostEnemy
output.
Misc
- The player's squad is
player_squad
. - npc_citizen NPCs have a spawnflag to place them in the player's squad on spawn:
65536
.