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] keyDefaultAllowsFolder / file
LuaApi1Loads the server's Lua API set: event scripts, game functions, timers... running on GameServer.Data\LuaAPI\Main.lua (+ System\, Includes\)
UiLua1Loads 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 LuaApi plugin to be purchased and [Plugin] LuaApi = 1. Otherwise GameServer does not load Data\LuaAPI and writes the log line "LuaAPI disabled".
  • To add a module: create a folder in Includes\ and then add one LoadModule line at the end of Main.lua. A faulty module only breaks itself.

UiLua

  • Requires the UiLua plugin 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>.ozg and <Name>.lua, declared in GfxList.xml with the line <Window Name="..." File="....ozg" Key="" Show="0" Enable="1" /> (Key is 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 example Ui_Player.GetMoney); window operations go through UI.*. Game data can only be changed while handling a button click (UI.OnMessage).
[TO VERIFY: the documentation could state the specific keys (F3 / F7) of the sample Lua UI windows; it has not been verified which keys apply, as that is decided by the GfxList.xml of each installation]

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).