Mapbase/Entities/NPCs/Custom Animations
Mapbase adds custom animations to many
Half-Life 2 NPCs and modifies many existing ones. These changes are intended to increase consistency between NPCs as well as provide additional capabilities for mappers and modders. These changes mainly apply to human NPCs, including npc_citizen, npc_combine_s, npc_metropolice, and other humans that share their animations with citizens (e.g. npc_alyx).)
Dynamic interactions
Mapbase ports Alyx's dynamic interactions with zombies to all human NPCs except npc_combine_s. They can be controlled using a new "Dynamic interactions enabled" keyvalue on NPCs.
Fix missing weapon animations
In default HL2, some NPCs cannot use certain weapons because they are missing the animations needed to support them. For example, npc_combine_s is not capable of using weapon_pistol in default HL2 without T-posing. Mapbase approaches this issue in two ways:
- By directly adding full animation sets for several weapons. For example, npc_combine_s now has a full animation set for weapon_pistol.
- By using a new "backup activity" system which allows NPCs to fall back to the nearest approximate weapon animation instead of T-posing. For example, a NPC with a weapon_rpg that has no RPG animations will fall back to weapon_smg1 animations.
Custom weapon animations
Mapbase adds completely custom animations for the following weapons:
Every NPC has custom aiming, firing, and/or reloading animations for the above weapons. They otherwise fall back to the aforementioned backup activity system.
Remapped activities
Many existing animations have had their Activity changed in order to be more consistent across different NPCs and work as would be expected from the base activity definitions.
For example, in stock Half-Life 2, if you place a npc_citizen with no weapon, it will use a generic unarmed idle animation called ACT_IDLE
. When the citizen is holding a weapon, it will use a weapon-specific animation with its own suffix, such as ACT_IDLE_SMG1
. This is known as translating activities, and all NPCs with weapons do it automatically.
However, even though all NPCs translate activities, not all NPCs have activities which match up with what the game expects. For example, npc_combine_s's base ACT_IDLE
actually holds a weapon. Its unarmed idle animation uses a separate ACT_IDLE_UNARMED
, which does not exist in any other NPC and can only be translated by custom code. This is why spawning a Combine soldier with no weapon causes them to still look like they're holding one in most games.
Mapbase changes the activities on these animations to be more consistent with the base implementation, and thus work as expected with their weapon state. For example, by changing the soldiers' unarmed activity to ACT_IDLE
, Combine soldiers will now look and act unarmed when they have no weapon.
The following animations have had their activities changed to something else:
combine_soldier_anims.mdl (npc_combine_s)

Sequence | Original Activity | New Activity | Notes |
---|---|---|---|
Idle1
|
ACT_IDLE
|
ACT_IDLE_AR1
|
This animation involves holding an assault rifle. "AR1" is the closest approximation given the hand position. |
Walk_all
|
ACT_WALK
|
ACT_WALK_AR1
|
This animation involves holding an assault rifle. "AR1" is the closest approximation given the hand position. |
RunALL
|
ACT_RUN
|
ACT_RUN_AR1
|
This animation involves holding an assault rifle. "AR1" is the closest approximation given the hand position. |
Idle_Unarmed
|
ACT_IDLE_UNARMED
|
ACT_IDLE
|
This is a "true" unarmed idle animation. In order to retain support for code which calls ACT_IDLE_UNARMED , the ACT_IDLE variant is a separate hidden sequence rather than a direct replacement.
|
WalkUnarmed_all
|
ACT_WALK_UNARMED
|
ACT_WALK
|
This is a "true" unarmed walking animation. In order to retain support for code which calls ACT_WALK_UNARMED , the ACT_WALK variant is a separate hidden sequence rather than a direct replacement.
|
CombatIdle1
|
ACT_IDLE_ANGRY
|
ACT_IDLE_ANGRY_AR2
|
This animation was created for the AR2 in mind. |
police_animations.mdl (npc_metropolice)
Sequence | Original Activity | New Activity | Notes |
---|---|---|---|
batonidle1 , batonidle2
|
ACT_IDLE
|
ACT_IDLE_MELEE
|
ACT_IDLE is normally used for unarmed animations and then translated to weapon counterparts.
|
walk_all
|
ACT_WALK
|
ACT_WALK_MELEE
|
ACT_WALK is normally used for unarmed animations and then translated to weapon counterparts.
|
run_all
|
ACT_RUN
|
ACT_RUN_MELEE
|
ACT_RUN is normally used for unarmed animations and then translated to weapon counterparts.
|
lowcover_shoot_pistol
|
ACT_RANGE_ATTACK_PISTOL_LOW
|
ACT_RANGE_ATTACK_PISTOL_MED
|
Part of the support added for "medium" cover. To be more consistent with other NPCs, there is a custom crouch animation which takes the place of this one. |
lowcover_aim_pistol
|
ACT_RANGE_AIM_PISTOL_LOW
|
ACT_RANGE_AIM_PISTOL_MED
|
Part of the support added for "medium" cover. To be more consistent with other NPCs, there is a custom crouch animation which takes the place of this one. |
lowcover_shoot_smg1
|
ACT_RANGE_ATTACK_SMG1_LOW
|
ACT_RANGE_ATTACK_SMG1_MED
|
Part of the support added for "medium" cover. To be more consistent with other NPCs, there is a custom crouch animation which takes the place of this one. |
lowcover_aim_smg1
|
ACT_RANGE_AIM_SMG1_LOW
|
ACT_RANGE_AIM_SMG1_MED
|
Part of the support added for "medium" cover. To be more consistent with other NPCs, there is a custom crouch animation which takes the place of this one. |
Medium cover support
[Todo]
Readiness animations
[Todo]
Unused weapon activities
Mapbase optionally comes with a bunch of unused weapon activity sets intended for use by mods. Many of these weapons exist or are mentioned in the SDK, but are not integrated into mods by default. This includes the following:
AR1
AR3
SMG2
SMG3
HMG1
SNIPER_RIFLE
DUAL_PISTOLS
In order to use these animation sets, they must be enabled in the code. Go to ai_activity.h
and set EXPANDED_HL2_UNUSED_WEAPON_ACTIVITIES
to 1 if you want to use them.
Regardless of whether these are enabled in code, Mapbase comes with custom animations for some of these weapon sets. For example, Combine soldiers have an animation set for the AR1 which uses a hand position more closely resembling that of a "traditional" assault rifle as opposed to the AR2.
Optional dynamic interactions
[Todo]