Skip to content

LuaUI Home

wezzzyrek1 edited this page Aug 14, 2026 · 2 revisions

Lua UI

Custom in-game windows written entirely in Lua: a script in the client's script folder and a matching script on the GameServer. No client patching, no server rebuild, and both sides reload with the rest of your Lua.

What it covers:

  • floating windows the player opens and drags, with the game's own frame artwork
  • HUD panels that sit permanently on screen as if they shipped with the client
  • lists that scroll, with a scrollbar styled in colours or cut from your own bitmap
  • text fields with per-keystroke validation, including CJK input through IME
  • a request/answer protocol of your own between the window and the GameServer

Turning it on

Lua UI comes from the LuaUI Ext plugin, which extends LuaAPI rather than replacing it - both have to be purchased, or there is no Lua to extend.

Server side, in Data\Plugins\PluginSettings.ini:

[Lua]
LuaUIEnable=1
LuaUIScriptKey=<32-character key>
ClientDevMode=0
DevModeAccounts=

LuaUIEnable switches the system on. LuaUIScriptKey is the key your encrypted window scripts (.usc) are packed with.

ClientDevMode is the developer switch, and the server pushes it to the client on connect - there is nothing to set on the client itself. Off, the client runs encrypted .usc scripts and nothing else, which is what a live server wants. On, it also loads plain .lua files, gives you the F9 reload key and the debug console; see File map.

DevModeAccounts limits dev mode to specific accounts. Give it up to ten comma-separated account names (DevModeAccounts=admin,tester2) and only they load plain .lua and get the debug console; everyone else runs the encrypted client. An empty list means no one gets dev mode - it is granted only to the accounts you name here.

The two halves

A window has a client half that draws it and a server half that decides what it may do. They talk over a channel addressed by window id + action; both sides read those numbers from a protocol file you keep in sync by hand.

They also run different Lua - the client is LuaJIT (Lua 5.1), the GameServer is Lua 5.3. File map lists what that changes in practice.

Adding a window means two scripts and two protocol entries. Nothing is registered in the client or the server itself.

The running example

The pages build one feature rather than a new toy each: a Coin Exchange that converts WCoin to Ruud. It ships with the update package as a sample and is meant to be read and copied from; nothing in the client or the server depends on it, so deleting it leaves everything documented here working. Its daily allowance and history persist in the database, from the SQL script the server half ships with.

Piece Where it is built
the exchange window, and a HUD ticker beside it Creating windows
its server half, and the open gate Client and server
the frame skin, and the ticker drawn from shapes Designing a window
its actions, result codes and the rate broadcast Protocol
the conversion history list Scrolling
the amount field and the voucher field Text input

Pages

Read in this order the first time; each one assumes the ones above it.

  1. File map - what each file is for and where it lives
  2. Creating windows - defining a window, sizing, placement, modes
  3. Client and server together - both halves of one window, and the open gate
  4. Designing a window - drawn from shapes, or cut from a bitmap
  5. Protocol - actions, result codes and payloads
  6. Scrolling and scrollbars - panels, lists, bar styling
  7. Controls - labels, buttons, images, panels
  8. Text input - length rules, filters, IME, encoding

See Also

Clone this wiki locally