Npc headcrab: Difference between revisions
(The burrowing health bug is confirmed to exist in Half-Life 2) |
(Fixed the description of the error, since the "addoutput "health 0"" input to the player doesn't activate the death event either) |
||
Line 13: | Line 13: | ||
{{ModernPlacementTip|Classic headcrabs can be paired with their [[npc_headcrab_fast|fast-moving]] or [[npc_headcrab_black|poisonous]] relatives to make it more interesting.}} | {{ModernPlacementTip|Classic headcrabs can be paired with their [[npc_headcrab_fast|fast-moving]] or [[npc_headcrab_black|poisonous]] relatives to make it more interesting.}} | ||
{{ModernPlacementTip|Avoid the cliche of placing headcrabs in vents; they would likely be more of an annoyance than an improvement on gameplay.}} | {{ModernPlacementTip|Avoid the cliche of placing headcrabs in vents; they would likely be more of an annoyance than an improvement on gameplay.}} | ||
{{bug|If a headcrab is burrowed, | {{bug|If a headcrab is burrowed, using the {{code|sethealth 0}} input on it will not kill the headcrab. The input gets ignored and the headcrab's health doesn't change. Despite that, such headcrab can still unburrow and behave normally. The {{code|kill}} input can still kill the headcrab but it will disappear instantly.|tested=Half-Life 2}} | ||
{{NPCNote}} | {{NPCNote}} | ||
{{code class|CHeadcrab|npc_headcrab.cpp}} | {{code class|CHeadcrab|npc_headcrab.cpp}} |
Revision as of 17:36, 6 September 2024
![]() |
---|
CHeadcrab |
![]() |
npc_headcrab
is a point entity available in Half-Life 2 series and
Black Mesa.
These are the classic, slow-moving headcrabs. They attack by jumping at the player's head and inflict a nominal amount of damage. Almost any weapon can dispatch them easily.
Commonly found attached to a zombie host body, they will detach if that host is sufficiently damaged below the head.
There are several other headcrab variants and associated zombie types.
See also env_headcrabcanister which is a mortar shell containing a payload of headcrabs. The mortar shell inflicts damage within a radius of where it lands and releases headcrabs after impact. Triggers and entity options offer control over impact damage and when the headcrabs are released, among other options.




Dedicated Console Variables
- sk_headcrab_health <int>
- A headcrab's spawn health.
- sk_headcrab_melee_dmg <int>
- Melee damage.
- g_debug_headcrab <bool>
- Toggle headcrab debugging.
- sk_headcrab_min_jump_dist <int>
- Headcrab min jump distance. Only in Black Mesa 2012.
- sk_headcrab_max_jump_dist <int>
- Headcrab max jump distance. Only in Black Mesa 2012.
- sv_headcrab_can_latch_on_player <bool>
- Toggles headcrab's ability to attach player's head (if player catches it with head). Only in Black Mesa 2012. Requires this texture to display properly as the texture has been removed.
Keyvalues
- Parent (parentname) <targetname>
- Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.
BaseHeadcrab:
- Start burrowed (startburrowed) <boolean>
- Should this npc start burrowed? Will unburrow via input or if an enemy gets near.
Note:If a headcrab is burrowed, it cannot be damaged. Use Kill input if needing to remove such headcrab.
Flags
- Start hidden : [65536]
- Start hanging from ceiling : [131072]
Inputs
- Burrow !FGD
- Burrow. If no burrow points within 512 units, does nothing.
- BurrowImmediate !FGD
- Burrow immediate.
- Unburrow !FGD
- Unburrow.
- StartHangingFromCeiling
- Start hanging from ceiling.
- DropFromCeiling
- Drop if hanging from ceiling.
- SetParent <string >
- Move with this entity. See Entity Hierarchy (parenting).
- SetParentAttachment <string >
- Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
- SetParentAttachmentMaintainOffset <string >
- As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
- ClearParent
- Removes this entity from the the movement hierarchy, leaving it free to move independently.
Outputs
|