A module is one Lua file in your server's scripts/modules folder. It listens to what happens in the game (a login, a kill, a level up, a Chip War result), can refuse or adjust a few things as they happen (an auction listing, a chat line, a pickup, a hit), adds staff and player commands and timers, keeps its own data, and acts through the server's own helpers: announcements, notices, mail, items, currency, buffs and warps.
Modules are how you customise a server without its source. RF Online: Dragonborn, RF Online: Age of Patron, RF Online 1.5 and RF Online: Golden Age run them today.
What Is in the Folder
| file | what it is |
|---|---|
scripts/modules/_template.lua | a small working module to copy; the leading _ keeps the server from loading it |
scripts/modules/examples/ | complete modules for common features; the server never loads this folder |
Switching Modules Off
Modules are on by default (lua.enabled), and a server with nothing in the folder does nothing extra. To stop every module, set lua.enabled to off on the GameCP's Settings page, under Lua Modules. Every event, gate, command and timer stops within ten seconds, with no restart.
Quick Start
You need a character at staff level 3 (Administrator). GM Accounts explains the levels.
- Copy
scripts/modules/examples/staff_presence.luaup one folder, intoscripts/modules/. - In game, type
%mod reload. The reply says how many modules loaded and names any problem. - Type
%mod list. The module is listed with its commands. - Type
.staffin any chat channel. The module answers with the staff online.
Your First Module
Save this as scripts/modules/welcome_back.lua:
module "welcome_back" {
api = 1,
title = "Welcome back",
version = 1,
settings = {
greeting = { kind = "text", max = 120, default = "Welcome back!", doc = "what a returning player sees" },
},
on = {
login = function(m, ev)
if not ev.first then
rf.notice(ev.player.id, m:setting("greeting"))
end
end,
},
}
Then type %mod reload, log a character out and back in, and read the system line. Change the text without touching the file:
%mod set welcome_back greeting Good to see you again.
To start from something larger, copy _template.lua to a new name without the underscore, rename the module inside it, and delete the parts you do not need.
The Rest of the Manual
| page | holds |
|---|---|
| Writing a Module | the file, its parts, reloading, timers |
| Settings and Commands | values an operator changes; staff and player commands |
| Events | what a module can listen to, with every field |
| Gates | what a module can refuse or change as it happens |
| Verbs | everything a module can call |
| Storage | bags and custom tables |
| New Messages | new wire messages for GoMMO Client |
| Examples | the shipped modules, and what each one shows |
| Running Modules | errors, limits, the %mod commands, server settings, troubleshooting |
Where the versions differ: Dragonborn, Age of Patron, RF Online 1.5 and Golden Age.