Skip to content

LuaUI Console

wezzzyrek1 edited this page Aug 18, 2026 · 2 revisions

Lua UI - Debug console

A separate black window your window scripts can print to while you build them. It is a developer tool: it opens only in dev mode, and a live client never shows it to a player.

It is its own window, independent of the game - you can drag it to a second monitor, and it keeps working while the game runs. The title bar shows the live cursor position, handy beside UIPlacement.

When it appears

The console is tied to the same dev-mode switch as plain .lua loading and the F9 reload (see Turning it on):

  • the GameServer must push dev mode to your client - ClientDevMode=1 in PluginSettings.ini, with your account listed in DevModeAccounts;
  • on a live client, or an account without dev mode, the console never opens and Log.Add does nothing.

There is also a local switch on the client, for a machine where you have dev mode but do not want the window. In the client's config.ini:

[Lua]
DisableDebugConsole=1

1 suppresses the console even in dev mode; 0 (the default) leaves it on.

Printing to it

Log.Add("hello")                               -- default grey
Log.AddC(Enums.Color.Red, "something broke")   -- coloured

Log.Add(text) prints in the default grey; Log.AddC(color, text) takes a colour first, from Enums.Color (below). The pair mirrors the server's Log.Add / Log.AddC. Off dev mode both are no-ops, so you can leave the calls in your scripts

  • they cost nothing on a live client.

Each line is timestamped. The window scrolls with the wheel or the bars: while you sit at the bottom it follows new output, and if you scroll up to read it leaves you there. It keeps the last 1000 lines.

Closing the window closes the client. It is a debug surface, not a panel to dismiss - the X shuts the game down.

Colours - Enums.Color

Enums.Color is a table of 140 named colours, shared with the rest of your UI. The values are ordinary client colours (RGBA, opaque), so the same name works wherever a colour is taken - not just in the console:

local Enums = require("Enums")

lbl:setColor(Enums.Color.Gold)         -- a label
Log.AddC(Enums.Color.Cyan, "info")     -- the console

The names are the usual web/X11 set - Red, Lime, Cyan, Orange, DeepSkyBlue, White, Gray, and so on. It mirrors the server's Enums.LogColor.

See Also

  • File map - dev mode, .usc vs .lua, F9 reload
  • Lua UI - turning dev mode on (ClientDevMode, DevModeAccounts)
  • Controls - the UI.* globals

Clone this wiki locally