Train Pause deprecated

by dorfl
A combinator to pause trains at stations until the next station is available.
1 year, 13 days ago
0.16
667
Owner: dorfl
Source: N/A
Homepage: https://gitlab.com/aerosuidae/trainpause
License: MIT
Created: 1 year, 30 days ago
Latest Version: 0.1.6 (1 year, 13 days ago)
Factorio version: 0.16
Downloaded: 667 times

Beta code!

Intended behaviour

If an entity connected via circuit to the combinator is a train stop with a parked
train, peek at the the train's schedule and emit a green signal if the next station
is available.

"Available" means: one or more stations with the next name are enabled and do
not have a train already en-route or stopped.

This has only been tested with relatively simple train setups so far so bug reports
welcome...

Setup

At any station where trains should wait:

  • Connect the combinator to the train stop with a circuit wire
  • Set trains to wait at the station until circuit condition GREEN > 0
  • Set train backlog (number of trains to release per destination station name) in mod settings

Vague plans

  • Make the backlog at target stations configurable per station name/stop

Why?

How is this different from using a train buffer?

The test use case is a city blocks base with an approach something like LTN-in-reverse. Trains get preloaded with resources and sent to queue at a central depot-style pause station. Delivery stations can be quickly serviced with no need to disable stations, use unique names, cater for long queues and rerouting, run circuit wires everywhere, or wait for resource loading.

Use Cases

  • Works OK: Controlling train throughput for a single destination station using one or more pause stations (the train buffer idea, but without the requirement for buffer proximity)
  • Works OK: Controlling train throughput for multiple destination stations with the same name roughly equidistant from the pause station(s), such as between city blocks.
  • Doesn't really work yet: when the multiple destination stations with the same name are very spread out, such as resource patches, because the Factorio train pathing can still be problematic. In that case have found it's still necessary to disable stations while in use (+ 1 second after departure).

Change Log

0.1.6:

  • check next station is enabled before green signal

0.1.5:

  • mod setting: green signal delay

0.1.4:

  • bugfix for train-pauser reverting to constant-combinator

0.1.3:

  • mod setting for train backlog per station

0.1.2:

  • use on_load

0.1.0:

  • entity remove lua error
  • icons

0.1.0:

  • Initial release