Documentation
Docs/en/reference/text-format/runtime.md
Runtime Text API
Generated reference. Do not edit directly. Update
BuildTools/TextFormatInterface.json, then runpython BuildTools/docs_text_format.py --write.
| Index | Syntax | Languages | Prototype text | Runtime | Validation | Canonical JSON | Guide |
The generated API reference owns the exact exported signatures. This page explains selection, missing-data behavior, and side availability.
Script methods
| Stable ID | Signature | Sides | Behavior | Missing or invalid input | Source |
|---|---|---|---|---|---|
text-format.runtime.get-language |
LanguageName Game.GetLanguage() |
server, client, mapper |
Returns the engine instance’s current language as a strong LanguageName wrapper; the configured Client.Language value is only the startup default. | Not applicable. | Source/Scripting/CommonGlobalScriptMethods.cpp |
text-format.runtime.get-current-text |
string Game.GetText(TextPackKey textKey) |
client, mapper |
Returns the first variant from the current client language. | A missing key returns an empty string. | Source/Scripting/ClientGlobalScriptMethods.cpp |
text-format.runtime.get-indexed-text |
string Game.GetText(TextPackKey textKey, int32 textIndex) |
client, mapper |
Returns the zero-based variant selected by textIndex from the current client language. | A missing key or out-of-range index returns an empty string; a negative index throws. | Source/Scripting/ClientGlobalScriptMethods.cpp |
text-format.runtime.get-language-text |
string Game.GetText(string langName, TextPackKey textKey) |
client, mapper |
An empty langName or the current language uses the current pack; another langName loads or reuses a cached pack and returns its first variant. | An absent or unsupported non-empty language has no automatic fallback and therefore yields an empty string for the key. | Source/Scripting/ClientGlobalScriptMethods.cpp, Source/Client/Client.cpp |
text-format.runtime.get-count |
int32 Game.GetTextCount(TextPackKey textKey) |
server, client, mapper |
Returns the number of variants stored under the complete key. | Returns zero when the key is absent. | Source/Scripting/ClientGlobalScriptMethods.cpp, Source/Scripting/ServerGlobalScriptMethods.cpp |
text-format.runtime.is-present |
bool Game.IsTextPresent(TextPackKey textKey) |
server, client, mapper |
Reports whether at least one variant exists under the complete key. | Returns false when the key is absent. | Source/Scripting/ClientGlobalScriptMethods.cpp, Source/Scripting/ServerGlobalScriptMethods.cpp |
text-format.runtime.change-language |
void Game.ChangeLanguage(string langName) |
client, mapper |
Loads langName into the current client pack and updates the engine-owned current-language state without mutating the configured Client.Language setting. | The Engine does not validate the identifier, apply another fallback, or invoke a project GUI refresh callback. | Source/Scripting/ClientGlobalScriptMethods.cpp, Source/Client/Client.cpp |
text-format.runtime.server-boundary |
server: IsTextPresent and GetTextCount only |
server |
The server loads one pack from the configured Client.Language startup value and exposes presence and count queries. | There is no server script Game.GetText overload in the Engine API. | Source/Server/Server.cpp, Source/Scripting/ServerGlobalScriptMethods.cpp |
Renderer-owned inline tags
| Stable ID | Rule | Requirement | Why | Source |
|---|---|---|---|---|
text-format.rendering.inline-color |
Inline color tags | The client font renderer recognizes @color:HEX@ to push a six- or eight-hex-digit color and @color@ to restore the previous color. | Color tags are renderer syntax, independent from text-pack parsing and project lexem formatting. | Source/Client/FontManager.cpp |
text-format.rendering.no-colorize |
NoColorize | FontFlag.NoColorize strips valid inline color tags while rendering all glyphs with the base color. | The formatting pass always removes recognized tags, but writes per-glyph colors only when colorization is enabled. | Source/Client/FontManager.h, Source/Client/FontManager.cpp |
The Engine does not interpret game lexems such as player-name, gender, argument, nested-text, or random-choice tags. An embedding project that adds them owns their grammar, tests, diagnostics, and ordering relative to renderer color tags.