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 provides a means of changing the default value of an entity’s keyvalues using entity templates. This can be used to globally change defaults such as the model used by an NPC or the amount of ammo in a weapon or ammo item.
Entity templates use the logger named ent.template. Enable it to trace template application during map load.

File Format

An entity template file is a JSON object where each key is a keyvalue name and each value is the string value to apply. Values must be strings and may be empty.

Example

{
    "default_ammo": "50" // Give MP5s a full magazine
}

Applying Templates to a Map

Templates are referenced from the map configuration file using the EntityTemplates section. It is recommended to place template files in the cfg/entitytemplates/ directory. Use subdirectories to group files for map packs and related actions. Refer to the Game Configuration System — EntityTemplates section for the full syntax of the EntityTemplates block.

See Also

Build docs developers (and LLMs) love