UTL Coupling Yard


Coupling and uncoupling for Unified Train Logistics: trains leave wagons at stations, shunting locomotives fetch, bring and park them.

Content
8 days ago
2.1
89
Logistics Trains

Changelog

Version: 0.0.4
Date: 2026-11-22
  Bugfixes:
    - Crash when loading a save with wagon yards after a mod was added, removed or updated (registry.lua:95, "attempt to index local 'stop' (a number value)"): UTL hands over train stops as numbers when the station list is rebuilt.
Version: 0.0.3
Date: 2026-11-22
  Features:
    - Wagon yard mode "Have wagons attached from behind": a train stops and waits, a shunting locomotive fetches wagons from the wagon yard named in "Attach wagons from", pushes them up to the rear of the train and couples them. The train then leaves pulling them – no locomotive facing backwards needed. Beta feature, map setting off by default.
    - "Wagons per shunting trip": the shunting locomotive takes only the first N wagons, the rest stays and is fetched on the next trip. Map setting, on by default.
    - "Add to standing wagons": shunting locomotives also bring wagons to a wagon yard where wagons already stand and couple them to the end (a queue, e.g. for direct insertion). Same map setting.
    - Tips and tricks: own category with scenes for leaving, picking up, shunting and attaching wagons.
    - Own tab in the UTL Manager, styled like UTL's settings tab: map settings of this mod with reset button and default (admins only), overview, list of shunting locomotives and of trains waiting for attached wagons.
  Changes:
    - Moving up to wagons runs every 2 ticks instead of every 5, so trains and shunting locomotives no longer jerk while they couple.
    - Without the map setting "move up to waiting wagons", shunting locomotives stop at a train stop facing the wagons or the waiting train (like a handover on one track) and couple right away. Only where there is no such stop, or a signal stands in between, they drive the last part themselves – at normal speed and braking, instead of at walking pace. Trains at a wagon yard do the same if they did not stop right at the wagons.
    - Scenario "large network" works with and without the beta feature: with it, the mainline train (one locomotive) gets the provided wagons attached; without it, it (two locomotives back to back) turns and fetches them at the pickup stop. It no longer switches any map setting.
    - Remote function "set_setting": sets a map setting of this mod (for tests).
  Bugfixes:
    - Wagons already standing were registered at every wagon yard within 40 tiles; the target of a shunting locomotive then counted as occupied and nothing was shunted. Each group of wagons now belongs to the nearest wagon yard only.
    - A shunting locomotive that is already close to the train or wagons it should couple to now moves up directly instead of giving up.
Version: 0.0.2
Date: 2026-11-04
  Locale:
    - French, Spanish, Portuguese (Brazil), Polish, Russian and Chinese (simplified), like Unified Train Logistics – for the mod and both scenarios.
Version: 0.0.1
Date: 2026-10-27
  Features:
    - New UTL station roles: wagon yard, shunting depot, turnaround.
    - Wagon yard: trains leave all wagons behind their locomotives and pick up the wagons waiting ahead of them, then carry on with their schedule. Mode per station: leave and pick up, only leave, only pick up.
    - Every coupling is announced to UTL, so deliveries and schedules survive it.
    - Shunting depot checks that shunting locomotives drive both ways.
    - Shunting: a wagon yard can name a target wagon yard (right away, when empty or when full). A free shunting locomotive fetches the wagons left there and brings them to the target, using a turnaround if needed.
    - Shunting picks a free target track among wagon yards with the same name and pushes the wagons in (via a turnaround if needed).
    - Relay: signal "Relay" with value N at a requester or provider routes its deliveries via the wagon yard with relay number N. The delivery stays with the wagons; the next train picking them up delivers it.
    - Wagon yard: a train that pushes its wagons in leaves them there and backs off (needs a locomotive facing backwards). Handover on a single track with two stops facing each other.
    - Wagon yard: "Control train limit" – the stop sets its train limit to 0 while wagons block it (leave) or none wait ahead (pick up).
    - Map setting "Wagon yard: move up to waiting wagons" (default off): without it, trains couple only when they stop right at the wagons.
    - Wagons already standing at a wagon yard are registered when the mod starts (remote function "scan").
    - Scenario "UTL Coupling Yard – large network": own network of 4 × 3 roundabouts with UTL traffic; an ore mine and a factory with transfer and shunting yards, a mainline train travels between them.
    - Shunting locomotives use the nearest turning stop, only work within 400 tiles, and approach wagons from the end the train pathfinder can reach (not through the wagons' own signal block).
    - Remote function "crawl": switches the map setting "move up to waiting wagons" (for scenarios).
    - Scenario "UTL Coupling Yard – shunting yard": large shunting yard with real loading and unloading, demo tracks.
  Info:
    - Pre-beta: first test version, things may still change.
    - No timers while nothing is being shunted.
    - Licensed under MIT.