openOMSI GitHub Discord

Docs / Plugins / Lua plugins

The launcher's plugin list

1 min readEdit this pagedocs/PLUGINS.md

The launcher's Plugins page lists every plugin of the plugins folders (Lua, .oop and .opl). Players switch each on or off there without moving its files, see what the last game made of it, and change the settings it declared with plugin.settings:

  • The plugins switched off are in ~/.openomsi/plugins-off.txt, one a line, in lower case, each by its path under plugins: foo.lua, a folder plugin's folder with a / after it (foo/ for foo/main.lua), foo.oop, and an .opl's path (pablo/mbas.opl). So foo.lua and foo/main.lua are two plugins, switched and set apart.

    A bare stem an older launcher wrote (foo) still leaves out every Lua or .oop plugin of that stem. The game reads it before it loads the plugins and leaves those out.

  • After loading, the game writes ~/.openomsi/plugins-status.json: every plugin, by the same name, with its state (loaded, off, failed with the load error, e.g. a syntax error) and, when one is switched off during the game for its errors, switched_off with the error.
  • plugin.settings(...) also writes settings.schema.json into the plugin's data folder, beside settings.json: {title, settings: [{key, type, label, default, min, max, step, choices}]}. The launcher makes a form of it and writes the values into settings.json, which the plugin gets back from plugin.settings the next time it starts. A plugin that has not run yet has no settings to show.

Publishing a plugin in the catalog#

The page's Browse tab lists the plugins of openOMSI-org/openOMSI-Plugins: a folder plugin (main.lua and its files) with a plugin.json (name, author, version, description, an open source licence), sent as a pull request and read by a maintainer before it is merged.

The launcher installs it as plugins/<id>/ only when each file's size and SHA-256 are the ones in the repository's catalog.json, offers an update when version goes up, and keeps plugins/<id>/data/ (settings and saved data) on an update. The repository's CONTRIBUTING.md has the rules.

Something wrong or missing? Fix it on GitHub or open an issue.

↑↓ to move↵ to open