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

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Christmas
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Apr 14, 2025 1:29 pm
Contact:

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

Post 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!
Loewchen
Global Moderator
Global Moderator
Posts: 9979
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

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

Post by Loewchen »



This works, but I expect it could be simplified.
Tertius
Smart Inserter
Smart Inserter
Posts: 1195
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

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

Post 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 151 times
Post Reply

Return to “Gameplay Help”