Page 1 of 1

How to make a train station stop accepting trains after 2 have visited

Posted: Mon Apr 14, 2025 1:42 pm
by Christmas
I’m trying to configure a train station so that it only allows 2 trains to visit. After those 2 trains have been processed, I want the station to stop accepting any further trains permanently. Essentially, once 2 trains have visited, the station should no longer appear as available, and no other trains should ever route to it.
Could someone please provide a detailed step-by-step explanation on how to achieve this using circuits, signals, or other in-game mechanics?
Thanks in advance!

Re: How to make a train station stop accepting trains after 2 have visited

Posted: Mon Apr 14, 2025 3:12 pm
by Loewchen


This works, but I expect it could be simplified.

Re: How to make a train station stop accepting trains after 2 have visited

Posted: Mon Apr 14, 2025 3:47 pm
by Tertius
Solution with 2 combinators. It counts the train visits, and the station is enabled only if there were fewer than 2 visits.

The combinator on the right is an edge detector. It detects a change of the T signal (train id), so whenever a train visits, one P=1 pulse is generated.
The combinator on the left has dual use. Its first use is to pass the T signal (train id) on green to the edge detector on red to supply a delayed T signal required by the edge detector. The second use is a counter for the P signal (generated by the edge detector) on the red wire. It counts and keeps the number of pulses in P. This signal is given back to the station where P can be used to enable/disable the station.
Also see the comments in the combinators.
04-14-2025, 17-41-04.png
04-14-2025, 17-41-04.png (94.05 KiB) Viewed 152 times