NRF SDK 0.9

Getting started

Find the right function

Start from the desired outcome to choose a Native or JVM API and guide.

Signals and in-game tools

Use package nimby in a Kotlin/Native project. The functions below are entry points; their guides explain conditions, unknown values and results to handle. Your rules remain specific to your mod.

Desired outcomeAPI to look upAuthor decision
Several signal modelssignalModel · signalMod · signal · IndicationAspect and reason types, rules and fallback for each model.
Decide from the networkrules · next · of · invalidNetworkLocal priorities, neighbour dependencies and unresolved links.
Detect an upstream approachobserveApproach · trainApproaching · approachingTrainNumber of observed blocks and effect of a confirmed approach.
Persistent settings and visibilitycheckbox · NumberSetting · enabled · number · settingsStatusStable identifiers, defaults, bounds, order and visibility.
Player preferences shared across gamesoptions · BooleanOption · IntegerOption · ChoiceOption · valueStable IDs, defaults, bounds and reading values in callbacks.
Customizable window shortcutwindow · ToolWindow.title · ToolWindow.shortcutAction title and initial shortcut; the SDK manages the player’s binding and conflicts.
Static or animated appearanceconstruction · images · appearance · steady · blinkResources, catalogue order and simulated-time cadence.
Describe driving behaviourdriving · AutomaticDriving · DrivingRuleSpeeds in m/s, stopping and release conditions.
Share preparation across signalsprepareNetwork · SignalBounded computation on copies without modifying persistent data.
Offer an optional serviceaction · whenMod · service · toolModProvider availability and behaviour when it is absent.
Panels, fields and windowsToolContext · ToolNumberInput · ToolWindowInput validation, window generation and callback lifetime.
Traverse and copy signalsToolTopology · travelDirection · placementAtTraversal bounds, unknown lengths and travel direction.
Preview then constructshowSignalPreview · createSignals · ConstructionResultConfirmation, tracking and permitted undo.
Read trains from a toolToolContext.trains · TrainQuery · TrainSnapshotRequired groups, freshness and retention of copied values.
Read the calendarToolContext.clock · GameDateTimeSimulated time and date conversion.
Translate and read resourcestr · translations.json · readTextFileVisible text, fallback language and package-relative paths.

Connected Kotlin/JVM applications

Use fr.nimby.sdk when your program runs separately from the game. Start with Nimby.connect, close resources you open and choose reads according to your needs. A retained observation remains a copy from its capture time.

Desired outcomeAPI to look upCheck
Connection and network snapshotNimby.connect · Game · snapshot · ObservationSelected game, connection lifetime, availability and session.
Trains and optional groupsGame.trains.snapshot · TrainQuery · TrainId · ObservationRequested, not requested, absent and empty are distinct states.
Lines and tagsLine · LineId · LineType · Tag · tagsForLineIdentities, inheritance and actually available values.
Service, timetables and delayTrainDetails · Timetable · LineStop · predictedArrivalDelaySecondsAbsolute time, plan offset and signed predicted delay.
Material and compositionTrainCharacteristics · TrainVehicle · VehicleModel · TrainMetadataConfiguration, current values, units, capacity and passengers.
Targeted dynamicsreadTrain · DrivingObservation · TrainDynamicsObserved speed, physical properties and unknown data.
Geometry and distancesTrackMetric · fraction · lengthMDirection and known length before conversion to metres.
CalendarGame.clock · SimulationClockSimulated time and result of requested changes.
Temporary controlGame.mods · ModControlSession · ControlRequestPermissions, duration, restoration and closure.
Creation and trackingConstructionTickets, partial results and permitted undo.
Application diagnosticsDiagnosticLogUseful events without a message on every read.

From project to verified package

The Gradle plugin applies to Native projects; the Kotlin reference distinguishes each Native/JVM API. For a specific function, open its type, read units and unknown-result semantics, then follow the linked guide example.