npc_metropolice

From Source Entities
Jump to navigation Jump to search
Hl2 metrocops.png

npc_metropolice is a point entity present in the Hl2.pngHalf-Life 2 series. City 17's police force. Civil Protection's ground units are anonymous both in face and in voice; anyone could have beat your friend, and also no one did. These hollow husks of the former dominant species are Gordon's first sign of Earth's fate upon his arrival. Metrocops, when not killing someone, stare deadly at the world they betrayed, only lashing out if someone's bugging them.

ConVars/Commands[edit | edit source]

ConVar/CommandParameters or default valueParameter TypeEffect
metropolice_chase_use_follow00 disables, 1 enablesCauses pre-criminal npc_metropolice with stunsticks to follow the player indefinitely.
metropolice_charge10 disables, 1 enablesSets whether npc_metropolice with pistols charge at the player.
sk_metropolice_health40health amountnpc_metropolice health when spawned.
sk_metropolice_simple_health26health amountnpc_metropolice health when the Simple cops flag is checked.
sk_metropolice_stitch_distance1000hammer unitsDistance at which npc_metropolice will begin to attempt stitching. (See Always stitch flag.)

Flags[edit | edit source]

  • 131072: Simple cops - Sets health to 26 instead of 40, uses more dramatic flinch animations when hurt.
  • 262144: Rappel (UNCHECK THIS IF IT IS CHECKED!) - No longer exists in code.
  • 524288: Always stitch - If the npc_metropolice is armed with an SMG and the player is beneath them, they'll shoot a meandering, closing path of bullets (like the first metrocop in d1_canals_07). Metropolice can only stitch if the player is in an airboat, unless this flag is checked.
  • 1048576: No chatter - Doesn't do anything except add the Gag flag. (Does affect an unused schedule, though.)
  • 4194304: No far stitching - Stops stitching if the player is over 6000 units away. (For reference, that's about the distance between the two forcefields on the bridge in d2_coast_07, so quite far away.)
  • 8388608: Prevent manhack toss - Does not allow manhack deployment (which is allowed by default, if the metrocop is carrying any manhacks). Deploying them can be allowed with EnableManhackToss.
  • 16777216: Allowed to respond to thrown objects - If the metrocop is carrying a stunstick, is not in a script, and gets something thrown at them, allow them to chase and hit the player. If the metrocop is unable to respond for any of these reasons, one that can and is nearby will.
  • 33554432: Mid-range attacks (halfway between normal + long-range) - Tells the metrocop it does not prefer extreme long range combat (3500 units).

Keyvalues[edit | edit source]

Pistol starts drawn (weapondrawn) <boolean>
Spawns the metrocop with the pistol in hand. Other weapons always spawn in hand.
Number of Manhacks (manhacks) <integer>
How many manhacks the metrocop has on him. By default, metrocops deploy them at will.

Inputs[edit | edit source]

EnableManhackToss
Unchecks Prevent manhack toss.
SetPoliceGoal <target_destination>
Tells the metrocop to guard an area defined by the specified ai_goal_police.
ActivateBaton <boolean>
Seems to be bugged. Can only do one thing: If the player has annoyed the metrocop enough for them to silently flick their stunstick on and moves out of his personal bubble (128 unit radius), the metrocop will shut the stunstick off immediately.

Outputs[edit | edit source]

OnCupCopped
Fires if a CBaseProp named cupcop_can hits the metrocop (has to be be thrown by the player with their hands or gravity gun).
OnStunnedPlayer
Fires when the metrocop whacks the player.