The Half-Life Unified SDK integrates AngelScript as its embedded scripting language. In the current SDK, AngelScript is primarily used for conditional evaluation inside configuration files, allowing settings to be included or excluded based on the current game state at runtime.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.
AngelScript scripting support uses the logger named
angelscript. Direct this logger to the appropriate output channel when debugging conditional expression failures.Conditional Evaluation
Some configuration files support conditional evaluation to selectively include settings. This mechanism uses AngelScript to evaluate a boolean expression at runtime. When a conditionally evaluated string is encountered, the SDK wraps it in a function body and compiles it as a complete AngelScript script:condition expression inside this function. The function is compiled, executed, and its bool return value determines whether the associated configuration block is applied.
Conditional Evaluation API
The following constants and values are available inside any conditionally evaluated expression.Constants
| Constant | Type | Description |
|---|---|---|
Singleplayer | bool | true if the game is running in singleplayer mode |
Multiplayer | bool | true if the game is running in multiplayer mode |
ListenServer | bool | true if the server is hosted by a player (listen server) |
DedicatedServer | bool | true if the server is running as a dedicated server |
GameMode | string | The name of the currently active game mode |
GameMode constant contains the string name of the active game mode. See the Game Modes page for a full list of available game mode names.