Skip to content

Client API

Everything a client script can use, in its players' games. It's all on the global sagl object, plus the standard timers.

sagl Channels to the gamemode, logging, timers, the local player, branding.
sagl.ui Documents, pause menu pages, the message box.
sagl.map Markers and overlays on the pause menu's map.
sagl.files The server's client files.
// A taste: a HUD the gamemode keeps up to date.
const hud = sagl.ui.openFile("ui/hud.rml", { input: false });
sagl.on("score", ({ cops, robbers }) => hud.setText("cops", cops).setText("robbers", robbers));
sagl.emit("ready", { at: sagl.player.position() });

Limits

Memory 32 MB for all scripts together.
Time 50 ms per call into a script (a handler, a timer); 250 ms to run a script when it loads.
Script size 1 MB each.
Messages 256 KB each way.
UI 16 open documents, 8 pause menu pages, 256 KB of RML each.