Coming soon toSteam
Modding docsAPI 1

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

  • assets Load the pictures and models your mod ships with, and make materials.
  • audio Play your mod's sounds and music.
  • camera Shake the view or change the field of view.
  • effects Particle effects — sparks, smoke, fire, glows.
  • http Send and receive data from websites over HTTPS.
  • input React to keys the player presses.
  • maps Which map is being played, the spawn points of a mod map, arriving on and leaving a map, and changing map from the server.
  • ui Windows, panels and buttons — both your own and the game's.
  • video Play video files your mod ships with, on a panel or on an object in the world.
  • world Put your own objects in the world, and ask about what is there.

Building

  • building Blocks, creations and the building editor.
  • kinetics Axles, gear teeth and meshes: make parts of creations turn, mesh and drive each other.

Scripting core

  • content Content definitions: things this mod adds to the game (blocks, maps, effects …).
  • events Publish and subscribe to events.
  • json Encode Lua values as JSON and parse JSON back.
  • log Writes to the mod log, shown in the mod manager, the DevTools console and the game's log file.
  • mod This mod: identity, lifecycle, exports for other mods, and the text and JSON files it ships with.
  • mod.settings The settings declared in mod.json, with their defaults.
  • mods Other mods: what is installed and running, and the exports of mods this one depends on.
  • net Messages between the client and server copies of your mod.
  • net.state Values the server sets and every player receives automatically — including players who join later.
  • players Who is in the session.
  • storage Persistent key/value data that survives restarts, saved automatically every 30 seconds and when the mod unloads.
  • task Work spread over many frames.
  • time Clocks.
  • timer Run a function later, or repeatedly.

Project Avion

  • cursor Show the mouse cursor while your window needs clicks.
  • notify Show the player a short message, the same way the game does.

Developer tools

  • devtools Add commands to the developer console (F1).

theonaris.planets

  • planets The planets of the current map: declare a map's planet system while your scripts load, then ask about gravity, air and weather.

Also