Lua scripting
Game modes and server features are Lua resources that the server runs and that act on the game only through the dlmp API. These pages are the contract resource authors rely on:
| Page | What it covers |
|---|---|
| Resources | The resource folder, the resource.toml manifest, dependencies, require and dlmp.import, client files, storage, and start, stop, reload and shutdown |
| Elements | Element families, ownership, handles, players, and events whose source was removed |
| Events, commands and timers | Subscribing to events, their order and refusal, player and console commands, timers |
| Errors and the sandbox | nil, err versus raised errors, errors in callbacks, the libraries, the time limit and what a resource cannot reach |
The function-by-function API reference is built from resources/.types/dlmp.lua, a type stub for Lua language servers that editors read for completion and checks. The shipped resources in resources/ are working examples, and the guides walk through parts of them. Decisions behind the API are in the architecture decisions; what crosses the wire is in the protocol.
