HitBoxes and HitGroups

The HitBoxes are used to define if an attack touch the player or a NPC.

The code execute a TraceAttack() to define where the bullet or a “blugeon based”(melee weapons) weapon hits a special part of the body, of an NPC, to apply the Flinch Animations.

The Death Activities can be defined and properly selected by the code , when the npc is dying in different situation. It could depends of the hit groups that has been hitted, by the player or an enemy of the npc.

This is simple example for a cube model.

$hboxset "default"
$hbox 0 "cube" -5.00 -5.00 -5.0 0.00 0.00 0.00

Hitboxes creation

The best way to create the hitboxes, use the HLMV and go on the Bone Tab.


HitGroups

0 = HITGROUP_GENERIC
1 = HITGROUP_HEAD
2 = HITGROUP_CHEST
3 = HITGROUP_STOMACH
4 = HITGROUP_LEFTARM
5 = HITGROUP_RIGHTARM
6 = HITGROUP_LEFTLEG
7 = HITGROUP_RIGHTLEG
10 = HITGROUP_GEAR

Example :

$hboxset "default"

$hbox 1 "ValveBiped.Bip01_Head1"	    -1.25   -6.50   -3.19     8.25    3.50    3.31
$hbox 4 "ValveBiped.Bip01_L_UpperArm"	     0.00   -2.75   -2.75    12.51    1.75    2.25
$hbox 4 "ValveBiped.Bip01_L_Forearm"	     0.00   -2.19   -2.38    13.00    1.81    1.62
$hbox 4 "ValveBiped.Bip01_L_Hand"	     0.06   -2.00   -1.50     4.06    1.00    2.50
$hbox 5 "ValveBiped.Bip01_R_UpperArm"	     0.00   -3.00   -2.25    12.39    2.00    2.75
$hbox 5 "ValveBiped.Bip01_R_Forearm"	    -0.50   -2.20   -1.55    12.50    1.80    2.45
$hbox 5 "ValveBiped.Bip01_R_Hand"	     0.06   -2.00   -2.50     4.06    1.00    1.50
$hbox 6 "ValveBiped.Bip01_L_Thigh"	     0.00   -3.75   -3.25    17.85    3.75    3.25
$hbox 6 "ValveBiped.Bip01_L_Calf"	     0.00   -3.51   -3.28    15.64    3.49    2.72
$hbox 6 "ValveBiped.Bip01_L_Foot"	    -1.07   -2.00   -2.84     5.04    5.00    2.16
$hbox 6 "ValveBiped.Bip01_L_Toe0"	    -0.50   -3.00   -2.19     2.50    0.00    2.46
$hbox 7 "ValveBiped.Bip01_R_Thigh"	     0.00   -3.75   -3.25    17.85    3.75    3.25
$hbox 7 "ValveBiped.Bip01_R_Calf"	     0.00   -3.51   -2.82    15.64    3.49    3.18
$hbox 7 "ValveBiped.Bip01_R_Foot"	    -1.06   -2.01   -2.28     5.05    4.99    2.72
$hbox 7 "ValveBiped.Bip01_R_Toe0"	    -0.50   -3.00   -2.60     2.50    0.00    2.10
$hbox 3 "ValveBiped.Bip01_Pelvis"	    -7.50   -5.50   -6.00     7.50    8.50    5.00
$hbox 2 "ValveBiped.Bip01_Spine2"	    -2.50   -2.50   -7.00    14.50    7.50    7.00

The Result :