npc_citizen
Jump to navigation
Jump to search
Code classes:
CNPC_CitizenCNPC_PlayerCompanionCAI_PlayerAllyCAI_BaseActorCAI_BaseNPC(NPCs)CBaseCombatCharacterCBaseFlexCBaseAnimatingOverlayCBaseAnimating(models)CBaseEntity(all ents)
npc_citizen is a point entity present in the
Half-Life 2 series. The downtrodden citizens of City 17. Timid when unarmed, they will rise up against their Combine oppressors when given a weapon.
Tip: To make citizens not greet the player upon seeing them, use an ai_speechfilter.
Flags[edit | edit source]
- 65536: Follow player on spawn
- 131072: Medic
- 262144: Random Head - Gives the citizen a random head. If the male/female flags are not checked, the head will be completely random.
- 524288: Ammo Resupplier
- 1048576: Not Commandable - Citizen will not listen to player commands or join their squad, and ignores them for the most part.
- 2097152:
Don't use Speech Semaphore- Use Don't Use Speech Semaphore(DontUseSpeechSemaphore)fromCAI_BaseActor.
- 4194304: Random male head
- 8388608: Random female head
- 16777216: Use RenderBox in ActBusies - Makes the NPC's hull as big as its rendering box when used in actbusies to keep things away from it.
Keyvalues[edit | edit source]
- Ammo to Resupply (if spawnflag set)
(ammosupply)<choices> - If Ammo Resupplier is set, which type of ammo to give.
- Amount of ammo to give
(ammoamount)<integer> - How much ammo to give.
- Type
(citizentype)<choices> - Clothing of the citizen.
- 0: Default - Sets type to refugee if the map name includes
canals,town, orcoastand rebel if the name includesc17. Otherwise, sets the type to downtrodden. - 1: Downtrodden - Clean blue suit.
- 2: Refugee - Dirty, raggier clothing.
- 3: Rebel - Full resistance getup and combat gear.
- 4: Unique - Set a particular model with Model.
- 0: Default - Sets type to refugee if the map name includes
- Expression Type
(expressiontype)<choices> - Facial expression when not overridden by anything else.
- 0: Random
- 1: Scared
- 2: Normal
- 3: Angry
- Fire output when Nav is blocked?
(notifynavfailblocked)<boolean> - Allows the OnNavFailBlocked output to fire when it's supposed to. No reason not to enable this.
- Permanent squad member?
(neverleaveplayersquad)<choices> - A permanent squad member cannot leave the player's squad unless killed or explicitly removed by entity I/O. Only use this if you're sure you want to override the default AI.
- 0: No, give up if can't get within 600 units of player and maintain LOS after 20 seconds of trying.
- 1: Yes, stay forever.
- Deny command speech concept
(denycommandconcept)<string>(only available in
Episodic
) - If you want your citizens to squad with the player but not obey commands the player gives to move the squad, put a concept here and this citizen will speak the concept instead of obeying the order.
Inputs[edit | edit source]
- RemoveFromPlayerSquad
- Removes the citizen from the player squad and adds them back to their previous one, if they had one.
- StartPatrolling
- Tells the citizen to wander around aimlessly.
- StopPatrolling
- Tells the citizen to stop wandering around.
- SetCommandable
- Unchecks Not Commandable.
- SetMedicOn
- Checks the Medic flag. Does not change the citizen's appearance.
- SetMedicOff
- Unchecks the Medic flag. Does not change the citizen's appearance.
- SetAmmoResupplierOn
- Checks the Ammo Resupplier flag.
- SetAmmoResupplierOff
- Unchecks the Ammo Resupplier flag.
- SpeakIdleResponse (Not in FGD)
- If the NPC has nothing better to do, say a random
TLK_ANSWERline. - ThrowHealthKit (Not in FGD) (only available in
Episodic
) - Launches a healthkit in the player's direction with no built-in animation or delay. Looks awful.
Outputs[edit | edit source]
- OnJoinedPlayerSquad
- Fires when the citizen joins the player squad.
- OnLeftPlayerSquad
- Fires when the citizen leaves the player squad (including when left by dying).
- OnFollowOrder
- Fires when the citizen is commanded by the player to follow them.
- OnStationOrder
- Fires when the citizen is told to go somewhere by the player.
- OnPlayerUse
- Fires when the citizen gets Used.
- OnNavFailBlocked
- Fires when the citizen is unable to real their goal.