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 outcome | API to look up | Author decision |
|---|---|---|
| Several signal models | signalModel · signalMod · signal · Indication | Aspect and reason types, rules and fallback for each model. |
| Decide from the network | rules · next · of · invalidNetwork | Local priorities, neighbour dependencies and unresolved links. |
| Detect an upstream approach | observeApproach · trainApproaching · approachingTrain | Number of observed blocks and effect of a confirmed approach. |
| Persistent settings and visibility | checkbox · NumberSetting · enabled · number · settingsStatus | Stable identifiers, defaults, bounds, order and visibility. |
| Player preferences shared across games | options · BooleanOption · IntegerOption · ChoiceOption · value | Stable IDs, defaults, bounds and reading values in callbacks. |
| Customizable window shortcut | window · ToolWindow.title · ToolWindow.shortcut | Action title and initial shortcut; the SDK manages the player’s binding and conflicts. |
| Static or animated appearance | construction · images · appearance · steady · blink | Resources, catalogue order and simulated-time cadence. |
| Describe driving behaviour | driving · AutomaticDriving · DrivingRule | Speeds in m/s, stopping and release conditions. |
| Share preparation across signals | prepareNetwork · Signal | Bounded computation on copies without modifying persistent data. |
| Offer an optional service | action · whenMod · service · toolMod | Provider availability and behaviour when it is absent. |
| Panels, fields and windows | ToolContext · ToolNumberInput · ToolWindow | Input validation, window generation and callback lifetime. |
| Traverse and copy signals | ToolTopology · travelDirection · placementAt | Traversal bounds, unknown lengths and travel direction. |
| Preview then construct | showSignalPreview · createSignals · ConstructionResult | Confirmation, tracking and permitted undo. |
| Read trains from a tool | ToolContext.trains · TrainQuery · TrainSnapshot | Required groups, freshness and retention of copied values. |
| Read the calendar | ToolContext.clock · GameDateTime | Simulated time and date conversion. |
| Translate and read resources | tr · translations.json · readTextFile | Visible 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 outcome | API to look up | Check |
|---|---|---|
| Connection and network snapshot | Nimby.connect · Game · snapshot · Observation | Selected game, connection lifetime, availability and session. |
| Trains and optional groups | Game.trains.snapshot · TrainQuery · TrainId · Observation | Requested, not requested, absent and empty are distinct states. |
| Lines and tags | Line · LineId · LineType · Tag · tagsForLine | Identities, inheritance and actually available values. |
| Service, timetables and delay | TrainDetails · Timetable · LineStop · predictedArrivalDelaySeconds | Absolute time, plan offset and signed predicted delay. |
| Material and composition | TrainCharacteristics · TrainVehicle · VehicleModel · TrainMetadata | Configuration, current values, units, capacity and passengers. |
| Targeted dynamics | readTrain · DrivingObservation · TrainDynamics | Observed speed, physical properties and unknown data. |
| Geometry and distances | TrackMetric · fraction · lengthM | Direction and known length before conversion to metres. |
| Calendar | Game.clock · SimulationClock | Simulated time and result of requested changes. |
| Temporary control | Game.mods · ModControlSession · ControlRequest | Permissions, duration, restoration and closure. |
| Creation and tracking | Construction | Tickets, partial results and permitted undo. |
| Application diagnostics | DiagnosticLog | Useful 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.