Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/twhl-community/halflife-unified-sdk/llms.txt

Use this file to discover all available pages before exploring further.

The Half-Life Unified SDK introduces a set of new entities, modifies a number of existing ones, and removes several that were obsolete, non-functional, or problematic. This page provides a complete reference to those changes. For documentation on entities that are unchanged from the original game, consult the TWHL entity guide.
Maps created for the original Half-Life or its expansion packs may need to be run through the MapUpgrader tool before they will work correctly with the Unified SDK. Removed entities are automatically converted to their replacements (where applicable) during this process.

Shared Keyvalues

Many keyvalues are available across multiple entity types. The tables below describe all shared keyvalues grouped by the category of entity that supports them.

Shared Between All Entities

KeyvalueSyntaxDescription
modelmodel <path>Custom model to use. Overrides the entity’s default model. Not all entities support custom models.
healthhealth <value>Custom health value. Overrides skill configuration or entity defaults. Negative values and 0 may cause malfunctions.
model_replacement_filenamemodel_replacement_filename <path>Relative path to a model replacement file. All search paths are checked.
sound_replacement_filenamesound_replacement_filename <path>Relative path to a sound replacement file. All search paths are checked.
sentence_replacement_filenamesentence_replacement_filename <path>Relative path to a sentence replacement file. All search paths are checked.
custom_hull_mincustom_hull_min X Y ZOverrides the minimum hull size specified by the model or entity.
custom_hull_maxcustom_hull_max X Y ZOverrides the maximum hull size specified by the model or entity.
classificationclassification <name>Overrides the entity’s classification. Must be a name defined in the entity classifications config file.
child_classificationchild_classification <name>Overrides the classification of entities spawned by this entity. Supports special values !owner and !owner_or_default.
unkillableunkillable <0|1>If 1, the entity takes damage but health never drops below 1. Only supported by some NPCs.
The classification and child_classification keyvalues work together with the Entity Classifications system to control NPC faction behaviour.

child_classification Special Values

ValueDescription
!ownerSets the child entity’s classification to that of the spawning entity.
!owner_or_defaultUses the spawning entity’s classification only if it has a custom one; otherwise falls back to the child’s default.
The child_classification keyvalue is supported by the Osprey, Black Ops Osprey, and Big Momma (Gonarch).

Shared Between All NPCs

KeyvalueSyntaxDefaultDescription
allow_item_droppingallow_item_dropping <0|1>1Controls whether this NPC drops items when killed.
is_player_allyis_player_ally <0|1|2>0Overrides the NPC’s relationship towards the player. 0 = default, 1 = always hostile, 2 = always friendly.
allow_followallow_follow <0|1>1Controls whether this NPC can be +USEd to follow the player (when friendly).
UseSentenceUseSentence <sentence_name>Sentence to play when the NPC starts following the player.
UnUseSentenceUnUseSentence <sentence_name>Sentence to play when the NPC stops following the player.
NPC following functionality is currently unfinished. Only barebones functionality has been implemented.

Shared Between All Items

KeyvalueDefaultDescription
respawn_delayCustom respawn delay (seconds). -1 disables respawn. Allows items to respawn in singleplayer.
stay_visible_during_respawn0If 1, the item remains visible during its respawn countdown instead of disappearing.
flash_on_respawn1If 1, the item flashes when it respawns.
play_pickup_sound1If 1, the item plays its pickup sound when collected.
fall_mode00 = item falls to the ground on spawn; 1 = item floats in place.
trigger_on_spawnTarget to trigger when the item (re)spawns.
trigger_on_despawnTarget to trigger when the item is picked up (despawns).

Shared Between All Ammo Types

KeyvalueDescription
ammo_amountAmount of ammo the player receives. -1 gives the maximum possible amount. 0 creates a fake ammo entity that gives nothing.

Shared Between All Weapons

KeyvalueDescription
default_ammoAmount of ammo in the weapon when first picked up (primary ammo type only). -1 gives maximum ammo. 0 makes the weapon start empty.

Shared Between All func_tank Entities

KeyvalueDefaultDescription
enemytype00 = target the player only; 1 = target all characters allied with the player.
enable_target_laser0If 1, shows a laser beam indicating where the tank is aiming. Only visible to the player controlling the tank.
target_laser_spritesprites/laserbeam.sprSprite used for the targeting laser beam.
target_laser_width1Width of the targeting laser beam (range: 0–255).
target_laser_color255 0 0Color of the targeting laser beam in R G B format.

New Entities

The following entities are new additions in the Unified SDK and have no equivalent in the original game.

ambient_music

Plays background music tracks. Replaces the removed target_cdaudio and trigger_cdaudio entities.

ammo_all

Gives the player a quantity of all ammo types at once.

ammo_generic

A configurable generic ammo entity for custom ammo types.

env_fog

Adds map-side fog control to the level.

logic_campaignselect

Used to trigger logic based on the currently active campaign.

logic_isskill

Fires outputs based on the current skill level setting.

logic_random

Fires one of several targets at random.

logic_setcvar

Sets a cvar to a specified value when triggered.

logic_setskill

Sets the current skill level when triggered.

logic_setskillvar

Sets an individual skill variable to a specified value.

player_sethealth

Sets the player’s health to a specified value when triggered.

player_sethudcolor

Changes the player’s HUD color when triggered.

player_setsuitlighttype

Sets the type of suit light (flashlight or night vision) when triggered.

player_hassuit

Fires different targets depending on whether the player has the HEV suit.

player_hasweapon

Fires different targets depending on whether the player has a specific weapon.

point_teleport

Teleports an entity to a specified origin and angle.

trigger_changekeyvalue

Changes a keyvalue on a target entity when triggered.

trigger_playerfreeze

Freezes or unfreezes player movement when triggered.

Modified Entities

The following existing entities have been changed in the Unified SDK. Each link leads to the full entity reference.
EntitySummary of Changes
func_breakableAdditional keyvalue support and behaviour refinements.
func_healthchargerExtended configuration options.
func_pushableAdditional keyvalue support.
func_rechargeExtended configuration options.
monster_blkop_ospreySupports child_classification keyvalue.
monster_genericExtended model and keyvalue support.
monster_ospreySupports child_classification keyvalue.
monster_tentacleBehaviour and keyvalue refinements.
monstermakerExtended spawn and classification control.
multi_managerImproved reliability; see Entity Triggering.
player_weaponstripExpanded strip options.
trigger_changelevelSupports persistent inventory in Co-op.
trigger_relayImproved trigger chain handling.
trigger_teleportExtended teleport configuration.

Modifications Affecting Multiple Entities

Sound and sentence names have been standardised across several entities. Where the original SDK used hard-coded strings, the Unified SDK provides keyvalues to override them.

Removed Entities

The following entities have been removed from the Unified SDK. Maps that reference them should be updated using the MapUpgrader tool.
EntityReason for Removal
target_cdaudioReplaced by ambient_music.
trigger_cdaudioReplaced by ambient_music.
func_tank_ofMerged into the standard func_tank entity.
func_tankmortar_ofMerged into the standard func_tankmortar entity.
func_tankrocket_ofMerged into the standard func_tankrocket entity.
func_tanklaser_ofMerged into the standard func_tanklaser entity.
test_effectNever used in any shipped map and non-functional.
world_itemsObsolete; replaced by individual item entities.
item_securityRemoved (no replacement).
trip_beamDebug-only entity never used in shipped content.
cycler_weaponCauses problems when weapon code changes; not practically useful.
The MapUpgrader tool automatically converts removed entities to their replacements where a direct replacement exists (for example target_cdaudioambient_music). Entities with no replacement are simply removed from the map.

Build docs developers (and LLMs) love