API reference · API 1 · game 0.1.0
API reference
Generated from the game's own registrations, so it lists exactly what a script can call in this version. Download theonaris.d.lua for autocompletion in VS Code (Lua extension), or api.json for tools.
Engine
assetsLoad the pictures and models your mod ships with, and make materials.audioPlay your mod's sounds and music.cameraShake the view or change the field of view.effectsParticle effects — sparks, smoke, fire, glows.httpSend and receive data from websites over HTTPS.inputReact to keys the player presses.mapsWhich map is being played, the spawn points of a mod map, arriving on and leaving a map, and changing map from the server.uiWindows, panels and buttons — both your own and the game's.videoPlay video files your mod ships with, on a panel or on an object in the world.worldPut your own objects in the world, and ask about what is there.
Building
Scripting core
contentContent definitions: things this mod adds to the game (blocks, maps, effects …).eventsPublish and subscribe to events.jsonEncode Lua values as JSON and parse JSON back.logWrites to the mod log, shown in the mod manager, the DevTools console and the game's log file.modThis mod: identity, lifecycle, exports for other mods, and the text and JSON files it ships with.mod.settingsThe settings declared in mod.json, with their defaults.modsOther mods: what is installed and running, and the exports of mods this one depends on.netMessages between the client and server copies of your mod.net.stateValues the server sets and every player receives automatically — including players who join later.playersWho is in the session.storagePersistent key/value data that survives restarts, saved automatically every 30 seconds and when the mod unloads.taskWork spread over many frames.timeClocks.timerRun a function later, or repeatedly.
Project Avion
Developer tools
devtoolsAdd commands to the developer console (F1).
theonaris.planets
planetsThe planets of the current map: declare a map's planet system while your scripts load, then ask about gravity, air and weather.
Also
- Handles: blocks, objects, players, sounds and the other things scripts hold
- Events
- Permissions
- Content types