Skip to content

API reference

This reference is generated from the OMX.ModAPI SDK on every change, so it always matches the published API. Resource projects reference the OMX.ModAPI package, which contains these assemblies:

  • OMX.ModAPI.Client.dll
  • OMX.ModAPI.Server.dll
  • OMX.ModAPI.Shared.dll
  • OMX.ModAPI.dll
Type Description
MetadataKey The grammar shared by metadata keys and custom-event names: owner:name, where the owner is the resource id that may write the key or emit the event. Ordinal and case-sensitive.
NetworkPayload
OmxApiVersion The version of this contract. A resource built against a newer minor version may use members this host lacks.
ResourcePermissions
ResourceStorageExtensions
Sdk Identifies the OMX 2 resource SDK.
TypedMetadata
TypedNetworkEvents
Type Description
IClientAudio Sound behaviours a client resource may change for the player at this computer. Everything starts as OMSI does it. A change applies from the next frame and is undone when the resource unloads; when several resources ask for different things, the one furthest from OMSI’s behaviour wins.
IClientEvents Events as a client resource sends and receives them. Own names may be name or resource-id:name; an event carries at most 16 arguments. Sending is queued and happens on the next frame.
IClientHud A resource’s text overlays and portable interactive panels. Item ids are local to the resource. Setting an existing id replaces it; items and subscriptions are removed automatically when the resource unloads.
IClientInput OMSI keyboard.cfg commands, after OMX has resolved physical keys and modifiers.
IClientMessages Server announcements received by this client.
IClientResource Infrastructure contract implemented by ClientResource. Resource authors derive from that base class.
IClientRuntime The client half of a resource: the local player’s own things, and asking the authority for the rest.
IClientVehicles
IClientWorld
IDriverView The local player’s adjustments to the driver view (F1): where their head sits in the cab, the field of view, and the head turning with the steering. The values are the player’s own settings, the same ones the in-game Driver view panel changes, so anything set here is saved with them; IDriverView.ExtraLookDegrees is the exception, for code that steers the view itself (head tracking, for example), and is never saved.
IEntity A live view of one entity. Reads are safe from any thread and return the state the engine published for the latest frame. Once the entity has gone, IEntity.IsValid is false and the properties keep their last values. Two views of the same entity are equal.
IEventSource<out T> Something a resource can subscribe to. The handler always runs on the subscribing resource’s own thread, one call at a time and in order, never on the engine thread; an exception it throws is logged against the resource and does not affect other subscribers. Dispose the returned object to stop. All subscriptions end when the resource is unloaded.
ILocalVehicle The local player’s own bus, which a client resource can drive. Writes are checked when called and applied on the next frame, before the vehicle’s scripts run.
IMap A read-only snapshot of the real loaded OMSI map and timetable. Static arrays come directly from global.cfg and the timetable manager; loaded tiles and simulation counts update every frame.
IMetadata An entity’s key/value metadata as one resource sees it. Every resource can read every qualified key; a resource writes only its own namespace. Own keys may be written as either name or modid:name; the host adds the namespace to short names. MetadataScope.Local is this side’s own table and changes immediately. The replicated scopes belong to the authority: a server resource writes them on any entity; a client resource may only ask for a change on its own player or vehicle, and the change appears (and IMetadata.Changed fires) once the authority has accepted it.
IPlayer
IPlayers
IResourceBus
IResourceLog
IResourceRuntime What both halves of a resource share. Threading: every member is safe to call from any thread. Reads return the state the engine published for the latest frame. Changes are checked when called (so invalid ones throw right there) and applied by the engine on its next frame. Subscribed handlers run on the resource’s own thread, never the engine’s, so a slow or failing resource cannot stall or crash the game.
IResourceScheduler
IResourceStorage
IScriptVariables A vehicle’s script variables (OMSI’s public variable table and string variables) as the latest frame left them. Names match case-insensitively, as OMSI scripts do. For another player’s bus these are the replicated values, which may lag by one network update.
IServerEvents Events as a server resource sends and receives them. Names are in the resource’s own resource-id:name namespace.
IServerMessages Server-authoritative messages displayed in clients’ existing multiplayer chat.
IServerResource Infrastructure contract implemented by ServerResource. Resource authors derive from that base class.
IServerRuntime The server half of a resource: the authority over every player, vehicle and the world.
IServerVehicles
IServerWorld The world as the authority changes it. Changes are applied on the next frame and reach every client. In multiplayer only the dedicated server’s resources hold this.
IVehicle
IVehicles
IWorld The world as the latest frame left it. Safe to read from any thread.
Type Description
BusStop
DriverDuty The timetable journey currently selected for the local player’s bus.
EntityId An entity identifier assigned by the authority (the dedicated server in multiplayer, the game’s own in-process authority in single player). Client and server resources see the same id for the same entity. Ids are never reused within a session; zero is never assigned.
EntityTransform
HudAction A click from a declarative HUD panel.
HudButton An action rendered by the host and reported through IClientHud.ActionInvoked.
HudMetric A prominent label/value shown in the panel’s summary grid.
HudPanel Portable dashboard content. It is deliberately declarative: resources describe information and actions while OMX owns rendering, input, accessibility and theme consistency.
HudPanelOptions Portable placement for an interactive dashboard panel. Offset and width use 1080p-scaled pixels.
HudProgress A bounded 0..1 progress indicator with a human-readable value.
HudRow A labelled detail shown beneath a panel’s summary.
HudTextOptions Portable presentation options for one text overlay. Offset is in 1080p-scaled pixels.
InputCommandChanged
MapEntryPoint
MapRoute
MapTile
MapTileCoordinate
MetadataChange One metadata write or removal. MetadataChange.NewValue is null for a removal.
MetadataKey<T> A strongly typed metadata key. Payloads use the same bounded serializer as typed events.
NetworkEvent A custom network event. NetworkEvent.Source is the sending player or vehicle, or EntityId.None when the authority sent it.
NetworkValue
ResourceEvent
ResourceInfo A resource’s identity. ResourceInfo.Id is also its namespace: the owner part of every metadata key it writes and event it sends (id:name), and the name listed in AllowedResources.
ServerMessage
VehicleSpawnRequest
VehicleTriggerFired
WorldTime
WorldWeather
Type Description
ApiSide Which half of a resource is running.
DistantScenerySounds What happens to a scenery object’s sounds once the object is far from the camera.
EntityKind
HudAnchor Screen corner used as the origin of a HUD text item.
HudTone Semantic colour used by portable HUD panels. The host maps it to its current theme.
MessageSeverity
MetadataScope
NetworkValueKind The deliberately small set of values accepted by the public metadata and custom-event API. Keeping this closed makes payload validation deterministic across resources, clients and servers.
ResourceCapabilities
SessionKind
Type Description
ClientResource Entry point for a client resource. OMX discovers the single public derived class, supplies a scoped runtime, wires lifecycle events and removes all subscriptions, timers, HUD and input state when the resource stops.
Type Description
ServerResource Entry point for a server-authoritative resource.