Runtime, logs, and UI¶
These global functions write to the WololoLabs log, report session state, or change the WololoLabs interface.
Logging¶
| Call | Log level |
|---|---|
log(...), Log(...) |
Info by default. |
LogDebug(...) |
Debug. |
LogInfo(...) |
Info. |
LogWarn(...), LogWarning(...) |
Warning. |
LogError(...) |
Error. |
Each call joins its values with tab characters. Use one prefix for every script.
LogInfo("[resource-label] script loaded")
LogWarn("[resource-label] assigned player is unavailable")
log and Log accept a level as the first value when you pass another value.
For example, log("warn", "message") writes a warning.
Log state changes and failures. Do not log every Update call.
Time and performance¶
| Call | Result |
|---|---|
GetHighResolutionTimeMs() |
A monotonic time in milliseconds. |
GetLuaTimingStats() |
Aggregate managed update/render counters for the current Lua engine. |
Use deltaSeconds from Update for normal script timers. Use
GetHighResolutionTimeMs() to measure a short operation in one session.
GetLuaTimingStats() returns these fields:
| Field | Meaning |
|---|---|
managedLastMs |
Duration of the latest update pass. |
managedMaxMs |
Longest update pass since application start. |
renderLastMs |
Duration of the latest render pass. |
renderMaxMs |
Longest render pass since application start. |
managedCount |
Number of update passes. |
workerEnabled |
true when background updates are enabled. |
The timing values include every loaded Lua script. They do not identify one script.
Session and interface state¶
GetApiCapability(callable) inspects a native function without executing it.
Pass the function itself, for example GetApiCapability(UnitsStop) or
GetApiCapability(player.GetCivilizationName).
implemented: false for compatibility placeholders; true for native implementations; absent for missing functions or Lua functions.available: false for placeholders. Stop, movement, target, follow, guard, patrol, attack-move, train, research, build, combat stance, formation, deletion, gather-inside, auto-scout, market trades, flare, resign, resource drop, rally point and town-center bindings check their packet layout and the current originating command session. Research also checks that its native predicate is resolved.player.GetSelectedObjects,object.GetProductionQueueandobject.GetProductionQueueCountcheck their discovered read layouts and live world, plus local-player availability or building-type identification respectively. For other implementations this field is absent: availability is unknown.supportsAppend: true for movement and default object-target commands, including tracked variants; false for the other recognized command bindings. Absent for unclassified callables. This describes the API option independently of currentavailablestate and does not mean production-queue insertion.reason:not-implemented,not-a-native-binding,packet-layout-unavailable,inactive-session,stale-session, oravailability-not-queryableas applicable.
Selection/production query probes additionally report selection-layout-unavailable,
production-queue-layout-unavailable, world-unavailable,
local-player-unavailable, or object-type-unavailable. A ready method still
may reject the particular player/object or encounter changing data. Inspect its
returned nil, reason; the probe does not read a selection or production queue.
Availability is a momentary layout/session readiness check, not validation of
command arguments, transport health, receipt capacity, game authority or game
acceptance. Always inspect the actual command result. An absent available
field must not be treated as either confirmed readiness or permanent lack of
support.
| Call | Result |
|---|---|
GetAssignedPlayerId() |
Assigned player ID, or 0. |
IsGamePaused() |
Current pause state. |
IsMenuOpen() |
true when no playable match is active. |
GetExecutablePath() |
Application executable path, or nil. |
SetEngineUIVisibility(value) |
Show or hide the WololoLabs interface. |
SetEngineUIVisibility changes the interface immediately. Keep an explicit
script state before you call it. Do not toggle the interface every update.
Related pages¶
Shelter and group-ungarrison commands also report packet-layout/session readiness:
SetUnitStanceSeekShelter, SetUnitStanceUngarrison, their tracked variants,
and their api aliases. SetUnitStanceGarrison shares the shelter binding.
For group ungarrison, optional occupant guards are checked at invocation and
execution; readiness does not establish that those occupants are still inside.
GetLuaTimingStats() returns managedLastMs, managedMaxMs, renderLastMs,
renderMaxMs, managedCount, and workerEnabled. Durations are milliseconds;
this is not a table indexed by script. An unavailable engine context returns an
empty table. The downloadable editor declarations describe these fields and the
runtime logging, clock, player-ID, menu, executable-path and camera helpers.
Game-options editor declarations¶
The declaration file includes the GameOptions returned by
GetCurrentGameOptions(), with nullable getters and explicit unsupported
placeholders. Player team, color and civilization methods take a zero-based
lobby slot (0..7), not an in-game player ID. SetRandomMapPoolLocations
currently accepts exactly one map ID.
Setter true reports a local options write. It does not prove that the host
accepted the value or that it was replicated to other players. These existing
lobby setters are separate from replicated gameplay commands such as
SetDiplomacy.