Skip to content

Examples

OMX ships these example resources. Each is an independent class library that references only OMX.ModAPI.

Example Shows
SpeedHUD A minimal client text overlay from the local bus’s velocity. The basis of Getting started.
VehicleController Watching and holding keyboard.cfg commands, and writing the bus’s real script variables and triggers.
ServerWelcome A server half that greets players as they join with an announcement.
SharedVehicleState Client and server custom events, plus server-owned synced vehicle metadata.
MultiplayerVehicleAdministration Server-validated inspect, spawn and despawn operations.
QuietFarScenery A client audio behaviour: stopping scenery sounds that OMSI would leave playing after their object is out of range.
VirtualBusCompany One project with both halves: an interactive company dashboard, clocking in and out, the player’s real timetable duty, server-side distance tracking, trip completion, saved pay and a leaderboard.

VirtualBusCompany builds both halves into one DLL and keeps its code in Client/, Server/ and Shared/ folders. The server tracks distance and pays drivers; the client shows the dashboard and sends requests:

// Client: ask the server to put this driver on shift.
Network.EmitToServer("shift", new SetShift(Active: true));
// Server: handle it, with the sending player resolved for you.
Network.On<SetShift>("shift", ChangeShift, Players.Get);

Install the same folder under resources on the client and on the dedicated server.