Cleanup is going to take awhile, so the site is back up but editing has been disabled.

Npc citizen

From HalfLife 2 Knowledge Base

Jump to: navigation, search

Contents

npc_citizen

Half-Life 2 NPC Entity


description

Citizen

Your fighting citizen as seen in "Follow Freeman" Check the spawnflags section for how to make a medic/ammo supplier/both

Will pick up any weapon they come across

properties

  • Target Path Corner target(target_destination)
    If set, the name of a path corner entity that this NPC will walk to, after spawning.
  • Squad Name squadname(String)
    NPCs that are in the same squad (i.e. have matching squad names) will share information about enemies, and will take turns attacking and covering each other.
  • Hint Group hintgroup(String)
    Hint groups are used by NPCs to restrict their hint-node searching to a subset of the map's hint nodes. Only hint nodes with matching hint group names will be considered by this NPC.
  • Hint Limit Nav hintlimiting(choices) - default: Limits NPC to using specified hint group for navigation requests, but does not limit local navigation.
    • 0 - No
    • 1 - Yes
  • Sleep State sleepstate(choices) - default: Holds the NPC in stasis until specified condition. See also 'Wake Radius' and 'Wake Squad'.
    • 0 - None
    • 1 - Waiting for threat
    • 2 - Waiting for PVS
    • 3 - Waiting for input
  • Wake Radius wakeradius(float) - default: 0
    Auto-wake if player within this distance
  • Wake Squad wakesquad(choices) - default: Wake all of the NPCs squadmates if the NPC is woken
    • 0 - No
    • 1 - Yes
  • Lighting Origin Hack lightingoriginhack(target_destination)
    Select a info_lighting_relative to specify a location to sample lighting from, instead of using this entity's origin.
  • Physics Impact Damage Scale physdamagescale(float) - default: 1.0
    Scales damage energy when this character is hit by a physics object. With a value of 0 the NPC will take no damage from physics.
  • Parent parentname(target_destination)
    The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
  • Weapons additionalequipment(choices)
    • "weapon_smg1" - SMG1
    • "weapon_ar2" - AR2
    • "weapon_stunstick" - Stun Stick
    • "weapon_crowbar" - Crow Bar
    • "weapon_shotgun" - Shotgun
    • "weapon_beerbottle" - Beer Bottle
    • "weapon_beerbottle2" - Beer Bottle2
    • "weapon_rpg" - RPG
    • "0" - Nothing
  • Ammo to Resupply (if spawnflag set) ammosupply(choices)
    • "Pistol" - Pistol
    • "SMG1" - SMG1
    • "SMG1_Grenade" - SMG1 Grenade
    • "AR2" - AR2
    • "Buckshot" - Shotgun
    • "RPG_Round" - RPG
    • "Grenade" - Grenade
    • "XBowBolt" - Crossbow Bolt
  • Amount of ammo to give ammoamount(integer) - default: 1
  • Type citizentype(choices)
    Default
    • 0 - Default
    • 1 - Downtrodden
    • 2 - Refugee
    • 3 - Rebel
    • 4 - Unique
  • Expression Type expressiontype(choices)
    Random
    • 0 - Random
    • 1 - Scared
    • 2 - Normal
    • 3 - Angry
  • Model model(choices)
    models/humans/group01/male_01.mdl
    • "models/humans/group01/male_01.mdl" - Male 1
    • "models/humans/group01/male_02.mdl" - Male 2
    • "models/humans/group01/male_03.mdl" - Male 3
    • "models/humans/group01/male_07.mdl" - Male 4
    • "models/humans/group01/male_08.mdl" - Male 5
    • "models/humans/group01/male_09.mdl" - Male 6
    • "models/humans/group01/female_01.mdl" - Female 1
    • "models/humans/group01/female_02.mdl" - Female 2
    • "models/humans/group01/female_03.mdl" - Female 3
    • "models/humans/group01/female_04.mdl" - Female 4
    • "models/humans/group01/female_06.mdl" - Female 5
    • "models/humans/group01/female_07.mdl" - Female 6
    • "models/humans/male_cheaple.mdl" - Cheaple Male 1
    • "models/odessa.mdl" - Odessa. DO NOT USE.
  • Facial expression override ExpressionOverride(string)
  • Fire output when Nav is blocked? notifynavfailblocked(choices)
    • 0 - No
    • 1 - Yes

spawn flags

  • 1: Wait Till Seen - default: OFF
  • 2: Gag (No IDLE sounds until angry) - default: OFF
  • 4: Fall to ground (unchecked means *teleport* to ground) - default: ON
  • 8: Drop Healthkit - default: OFF
  • 16: Efficient - Don't acquire enemies or avoid obstacles - default: OFF
  • 128: Wait For Script - default: OFF
  • 256: Long Visibility/Shoot - default: OFF
  • 512: Fade Corpse - default: OFF
  • 1024: Think outside PVS - default: OFF
  • 2048: Template NPC (used by npc_maker, will not spawn) - default: OFF
  • 4096: Do Alternate collision for this NPC (player avoidance) - default: OFF
  • 8192: Don't drop weapons - default: OFF
  • 65536: Follow player on spawn - default: OFF
  • 131072: Medic - default: OFF
  • 262144: Random Head - default: ON
  • 524288: Ammo Resupplier - default: OFF
  • 1048576: Not Commandable - default: OFF
  • 2097152: Don't use Speech Semaphore - default: OFF
  • 4194304: Random male head - default: OFF
  • 8388608: Random female head - default: OFF
  • 16777216: Use RenderBox in ActBusies - default: OFF


inputs

  • SetLightingOriginHack(string)
    Sets the info_lighting_relative for the studiomodel. Use a null string to deactivate the use of specific lighting origins.
  • SetRelationship(string)
    Changes this entity's relationship with another entity or class. Format
  • SetHealth(integer)
    Set this NPC's health.
  • SetBodyGroup(integer)
    HACK
  • physdamagescale(float)
    Sets the value that scales damage energy when this character is hit by a physics object. NOTE
  • Ignite(void)
    Ignite, burst into flames
  • Break(void)
    Break, smash into pieces
  • StartScripting(void)
    Enter scripting state. In this state, NPCs ignore a variety of stimulus that would make them break out of their scripts
  • StopScripting(void)
    Exit scripting state.
  • Assault(string)
    Start an assault. Parameter passed in should be the name of the rally point.
  • SetSquad(string)
    Set the name of this NPC's squad. It will be removed from any existing squad automatically. Leaving the parameter blank will remove the NPC from any existing squad.
  • Wake(void)
    Wakes up the NPC if it is sleeping.
  • ForgetEntity(string)
    Clears out the NPC's knowledge of a named entity.
  • GagEnable(void)
    Turn on the NPC Gag flag.
  • GagDisable(void)
    Turn off the NPC Gag flag.
  • IgnoreDangerSounds(float)
    Ignore danger sounds for the specified number of seconds.
  • SetParent(string)
    Changes the entity's parent in the movement hierarchy.
  • SetParentAttachment(string)
    Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
  • ClearParent(void)
    Removes this entity from the the movement hierarchy, leaving it free to move independently.


outputs

  • OnDamaged(void)
    Fired when this NPC takes damage.
  • OnDeath(void)
    Fired when this NPC is killed.
  • OnHalfHealth(void)
    Fired when this NPC reaches half of its maximum health.
  • OnHearWorld(void)
    Fired when this NPC hears a sound (other than combat or the player).
  • OnHearPlayer(void)
    Fired when this NPC hears the player.
  • OnHearCombat(void)
    Fired when this NPC hears combat sounds.
  • OnFoundEnemy(string)
    Fired when this NPC establishes line of sight to it's enemy (outputs entity).
  • OnLostEnemyLOS(void)
    Fired when this NPC loses line of sight to it's enemy.
  • OnLostEnemy(void)
    Fired when this NPC loses it's enemy. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
  • OnFoundPlayer(string)
    Fired when this NPC establishes line of sight to it's enemy, and that enemy is a player (outputs player entity).
  • OnLostPlayerLOS(void)
    Fired when this NPC loses line of sight to it's enemy, and that enemy is a player.
  • OnLostPlayer(void)
    Fired when this NPC loses it's enemy, and that enemy was a player. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
  • OnDamagedByPlayer(void)
    Fired when this NPC is hurt by a player.
  • OnDamagedByPlayerSquad(void)
    Fired when this NPC is hurt by a player OR by one of the player's squadmates.
  • OnDenyCommanderUse(void)
    Fired when this NPC has refused to join the player's squad.
  • OnWake(void)
    Fired when this NPC comes out of a sleep state.


related tutorials

Submit your tutorial for npc_citizen

Personal tools