Docs / Plugins / Writing plugins
Kinds of plugins
openOMSI runs three kinds of plugins.
| Kind | File | Made with | Runs on |
|---|---|---|---|
| Lua plugin | .lua |
any text editor | Windows, macOS, Linux, Android |
| Compiled plugin | .oop |
the openOMSI Development Tools (Lua or Rust) | Windows, macOS, Linux, Android |
| OMSI 2 plugin | .opl + DLL |
as for OMSI 2 | Windows; macOS and Linux through Wine |
| Native plugin | .native.dll, .so, .dylib |
Rust or any language with a C interface | the system it was built for |
Lua plugins are plain text. There is nothing to compile, and the game loads a plugin again within a second after you save its file.
They reach the whole game through the plugin API: the player's bus, the duty and timetable, the map, AI traffic and people, weather and time, camera, input, sound, panels on the screen, storage, settings and the LAN session, and with full access the whole computer: files, network and programs. That is about 380 functions and 66 events.
Compiled plugins (.oop, "openOMSI plugin") are build output, not sources. One file works on every system. The code is either Lua compiled into an obfuscated chunk, or WebAssembly (usually from Rust). They run in a sandbox with only the permissions they declare. See Compiled plugins.
OMSI 2 plugins are the original game's .opl files with their DLLs, loaded unchanged. See OMSI 2 DLL plugins.
Native plugins are shared libraries with full access to the computer, for what the sandbox does not allow. Any plugin the player trusts can have that access too. See Full access.
A vehicle can also carry its own scripts, which run as plugins while the player drives it. See Scripts in a vehicle.
Something wrong or missing? Fix it on GitHub or open an issue.