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 extends the original entity triggering system with two significant additions: wildcard target matching and target selectors. Both features allow level designers to write more flexible and powerful trigger chains without needing to name every entity individually or wire up complex intermediate entities.
The entity triggering system uses the logger named ent.io. Enable it to trace trigger firing, wildcard resolution, and selector lookups during map development.

Wildcard Targeting

Any target keyvalue in the SDK supports a wildcard character (*) at the end of a target name. When a wildcard is used, the trigger fires all entities whose name starts with the given prefix — not just the first match.

Syntax

Place * at the very end of a target name:
"target" "room1_*"
This will fire every entity whose name begins with room1_.

Example

Suppose you have the following entities placed in a map:
EntityName
func_doorroom1_door1
env_spriteroom1_sprite1
func_buttonentrance_button
If entrance_button has its target set to room1_*, triggering the button will fire both room1_door1 and room1_sprite1 simultaneously.
Wildcards are only supported at the end of a target name. A wildcard in the middle of a name (for example room*_door) is not supported. Entity names themselves also cannot contain a wildcard character.

Target Selectors

Target selectors are special tokens that resolve to a specific entity in the current trigger execution context rather than looking up an entity by name. They can be used in any keyvalue that accepts a target name, including target, killtarget, and similar fields.

Supported Selectors

SelectorResolves To
!activatorThe entity that started the current trigger execution.
!callerThe last entity in the trigger execution chain.

Example

To kill the player who activated a trigger:
"killtarget" "!activator"
This is useful in trap sequences or puzzle logic where the outcome should act on whoever set the chain in motion. To reference the previous entity in a chain (for example to move or modify it):
"target" "!caller"
Some entities do not pass the activator through the chain correctly. For example, trigger_relay passes itself as the activator rather than forwarding the original one. Test activator-dependent trigger chains carefully when trigger_relay or similar relay entities are involved.

See Also

Build docs developers (and LLMs) love