Overview
These two keys do not add any immediately visible effect; instead they allow GameServer to load the Lua systems. For writing scripts (functions, examples) see the Lua API documentation section (Lua API).
[Plugin] key | Default | Allows | Folder / file |
|---|---|---|---|
LuaApi | 1 | Loads the server's Lua API set: event scripts, game functions, timers... running on GameServer. | Data\LuaAPI\Main.lua (+ System\, Includes\) |
UiLua | 1 | Loads Lua UI: the server side of custom-designed interface windows; it has its own Lua state, separate from LuaAPI (an error or reload on this side does not affect LuaAPI). | Data\Lua_Ui\Main.lua (+ System\, Includes\) |
LuaApi
- Requires the
LuaApiplugin to be purchased and[Plugin] LuaApi = 1. Otherwise GameServer does not loadData\LuaAPIand writes the log line "LuaAPI disabled". - To add a module: create a folder in
Includes\and then add oneLoadModuleline at the end ofMain.lua. A faulty module only breaks itself.
UiLua
- Requires the
UiLuaplugin to be purchased and[Plugin] UiLua = 1. Otherwise GameServer does not load Lua UI (log "Lua UI disabled") and the client cannot open Lua UI windows. - Client side: each window consists of
Data\Custom\Interface\GFx\<Name>.ozgand<Name>.lua, declared inGfxList.xmlwith the line<Window Name="..." File="....ozg" Key="" Show="0" Enable="1" />(Keyis the key that opens the window;Enable="0"skips the window). If UiLua is not purchased, the Lua UI window's key is not blocked by the client and the window is not shown. - In Lua UI, game data functions use the prefix
Ui_(for exampleUi_Player.GetMoney); window operations go throughUI.*. Game data can only be changed while handling a button click (UI.OnMessage).
Configuration
[Plugin]
LuaApi = 1
UiLua = 1
Applying changes
Click Reload plugin on the GameServer panel: it reloads LuaAPI and Lua UI according to the current purchase status + switch (turning a switch off unloads the corresponding Lua set).