WePlay: LTN Cleanup Stop


LTN trains that leave a requester with leftover cargo visit cleanup stops marked with a signal, then return to their depot. Handles mixed items and fluids, quality, multiple stops, fluid wildcards, LTN network IDs and train lengths, and keeps junk-carrying trains out of service.

Tweaks
3 hours ago
2.1
3
Trains
Owner:
afewvowels
Source:
N/A
Homepage:
N/A
License:
The Unlicense (Public Domain)
Created:
3 hours ago
Latest Version:
0.1.1 (3 hours ago)
Factorio version:
2.1
Downloaded by:
3 users

WePlay: LTN Cleanup Stop

Trains that leave a requester with leftover cargo go clean up before heading home. No more LTN trains wandering back into service with junk in their wagons.

Built from scratch for Factorio 2.1 and LTN (Logistic Train Network) 3.5+, with quality support, mixed item and fluid cargo, and multi-stop cleanup routes. Inspired by the original LTN Cleanup by keombre.


How it works

  1. A train finishes a delivery but still has cargo aboard.
  2. On its way back to the depot, it visits the cleanup stops that take its leftovers.
  3. It waits at each one until those leftovers are gone, then returns to its depot, clean and ready for the next delivery.

No new entities to build. Cleanup stops are ordinary train stops (vanilla or LTN) marked with a signal in their name.


Setting up a cleanup stop

Open a train stop's name and add the LTN cleanup station signal. The rest of the name can be anything you like.

Then add what the stop takes:

  • Item or fluid icons: the stop takes only those. An item icon with a quality takes only that quality; without one, it takes every quality.
  • Any item signal: the stop takes any leftover item.
  • Any fluid signal: the stop takes any leftover fluid.

Examples:

  • [cleanup] [iron plate] [copper plate] Smelter dump: iron and copper only
  • [cleanup] [any item] Junk yard: any item
  • [cleanup] [any fluid] Fluid void: any fluid
  • [cleanup] [any item] [any fluid] Everything: anything at all

Use the rich text button in the rename box to pick the signals and icons, no typing needed.


Features

  • Mixed cargo: a train carrying several items, items and fluids, or more than one fluid visits as many cleanup stops as it needs.
  • Smart routing: stops that name the train's leftovers come first, and wildcard stops take whatever's left. One stop that takes everything beats two that each take half. Among equal choices, a train picks a stop with room under its train limit, then the nearest.
  • Quality aware: cleanup stops can take a specific quality or all of them.
  • LTN stops as cleanup stops: a cleanup stop that is an LTN stop respects its network ID and minimum/maximum train length.
  • Depot safety net: a train that reaches an LTN depot with cargo (a failed delivery, items added by hand) is sent to clean up. Normally LTN would put it straight back into service with that cargo aboard.
  • No cleanup stop for it? The train is parked in manual mode at its depot with an alert, so LTN can't hand it a new delivery with junk aboard. Empty it and switch it back to automatic. Prefer LTN to keep using it? There's a setting for that.
  • Quiet by default if you want: chat messages are a per-player setting. Parked trains always raise an alert.

Settings

  • When no cleanup stop takes the cargo (map): park the train at the depot, or let LTN use it anyway.
  • Show LTN cleanup chat messages (per player): on or off.

Tips

  • A cleanup stop needs something that actually empties the wagons: filtered inserters or loaders into chests, pumps into tanks. A train waits at a cleanup stop until the leftovers it was sent there for are gone.
  • Build as many cleanup stops as you like. Train limits work as usual.
  • Keeping trains from picking up junk in the first place is even better: wire your provider loaders to load only what LTN requested.

Compatibility

  • Requires LTN - Logistic Train Network 3.5.0+ on Factorio 2.1.
  • Works with or without Space Age.
  • Safe to add to an existing save.

More WePlay mods

Small quality of life tweaks for Factorio: see all WePlay mods