Ai ally manager: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(.)
m (Added a sprite from TeamSpen210's Hammer addons)
Line 1: Line 1:
{{lang|Ai ally manager}}
{{lang|Ai ally manager}}
{{hl2 point|ai_ally_manager}} 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.
{{hl2 point|ai_ally_manager|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 00:54, 11 November 2022

English (en)Translate (Translate)

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