Detect if Train Stop Open

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
User avatar
Midge
Inserter
Inserter
Posts: 20
Joined: Wed Oct 12, 2022 6:12 pm
Contact:

Detect if Train Stop Open

Post by Midge »

I have a train that has the following route:
1. Steel Pickup
[Wait until 5s of Inactivity]
2. Stick Pickup
[Wait until 5s of Inactivity]
3. Waiting Cell
[this is what I'm trying to figure out]
4. Steel and Sticks Dropoff
[Wait until Empty]

This train picks up sticks and steel for the production of rails, I have a circuit connected to the station that closes the station when rail storage becomes full. I want the train to detect when the station opens so it can leave the waiting cell to deliver the now needed materials.

mmmPI
Smart Inserter
Smart Inserter
Posts: 2734
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Detect if Train Stop Open

Post by mmmPI »

You need to alter the 4rth station so that instead of open close, you set the limit from 1 to 0.
1 sec inactivity on the 3rd station should be good then.

This works if you only have 1 station called "stick and steel dropoff".

The train will see it with limit : 0 and will wait at the previous station (the waiting one) until the limit is not 0 anymore.

Then when empty, the train will go pick up steel
then stick

then go wait 1 sec, but will see "0 limit" for the next station on schedule, so it will wait.

I assume you have set filer on wagon.

User avatar
Midge
Inserter
Inserter
Posts: 20
Joined: Wed Oct 12, 2022 6:12 pm
Contact:

Re: Detect if Train Stop Open

Post by Midge »

mmmPI wrote:
Wed Oct 12, 2022 6:48 pm
You need to alter the 4rth station so that instead of open close, you set the limit from 1 to 0.
1 sec inactivity on the 3rd station should be good then.

This works if you only have 1 station called "stick and steel dropoff".

The train will see it with limit : 0 and will wait at the previous station (the waiting one) until the limit is not 0 anymore.

Then when empty, the train will go pick up steel
then stick

then go wait 1 sec, but will see "0 limit" for the next station on schedule, so it will wait.

I assume you have set filer on wagon.
Thank you so much, it worked

mmmPI
Smart Inserter
Smart Inserter
Posts: 2734
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Detect if Train Stop Open

Post by mmmPI »

Midge wrote:
Wed Oct 12, 2022 7:28 pm
Thank you so much, it worked
glad it worked for your purpose

Another way to do would be to have the train in the waiting area waiting for a signal condition to depart for the dropoff. And then use a wire to transmit something like 1 green signal to trigger the train leave condition when things are missing in the dropoff. That require the dropoff and the waiting area to be connected via a potentially long wire but it could allow to "call" different train based on different missing things is you send different signals, like 1 green if you miss steel to make the steel train stop waiting and delivers instead, and 1 red if you need stick to make the stick train stop waiting :).

Post Reply

Return to “Gameplay Help”