Ai ally manager: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Updated old entity format to {{this is a}}. This action was perfomed by a bot under supervision.)
Line 1: Line 1:
{{entity|ai_ally_manager|type=e0|series=Half-Life 2|sprite=1}} It monitors the number and type of {{ent|npc_citizen}} allies and responds accordingly. When this entity receives a <code>Replenish</code> [[input]], it will count the number of allies and send [[output]]s based on how many allies are needed to match this entity's [[keyvalue]]s. Also fires an output when all allies and/or all medics are dead.
{{this is a|e0|name=ai_ally_manager|series=Half-Life 2|sprite=1}} It monitors the number and type of {{ent|npc_citizen}} allies and responds accordingly. When this entity receives a <code>Replenish</code> [[input]], it will count the number of allies and send [[output]]s based on how many allies are needed to match this entity's [[keyvalue]]s. Also fires an output when all allies and/or all medics are dead.


Notes:
Notes:

Revision as of 12:47, 3 January 2024

Ai ally manager.png

ai_ally_manager is an e0 available in Half-Life 2 series Half-Life 2 series. It monitors the number and type of npc_citizen allies and responds accordingly. When this entity receives a Replenish input, it will count the number of allies and send outputs based on how many allies are needed to match this entity's keyvalues. Also fires an output when all allies and/or all medics are dead.

Notes:

  • Outputs can be used for purposes aside from spawning more NPCs.
  • More than one ai_ally_manager can exist.
  • Won't count more than 10 allies.
Note.pngNote:This entity is also in the code for Portal. Its functionality is not guaranteed.


C++ In code, it is represented by theCAI_AllyManagerclass, defined in theai_allymanager.cppfile.

ConVars/Commands

Cvar/Command Parameters or default value Descriptor Effect
ai_ally_manager_debug 0 0 disables, 1 enables Periodically prints the count of allies and medics to the console. Requires developer 1.

Keyvalues

Maximum number of allies (maxallies) ([todo internal name (i)]) <integer>
Maximum number of allies.
Maximum number of medics (maxmedics) ([todo internal name (i)]) <integer>
Maximum number of allies that are medics.


Inputs

SetMaxAllies <integerRedirectInput/integer>
Set maximum number of allies.
SetMaxMedics <integerRedirectInput/integer>
Set maximum number of medic allies.
Replenish
Spawn more allies as requested by the keyvalues.


Outputs

OnZeroAllies
Fired when there are no more allies.
OnZeroMedicAllies
Fired when there are no more medics left.
SpawnAlly0 to SpawnAlly9
Fired when allies 0 to 9 spawn.
SpawnMedicAlly
Fired when a medic ally spawns.