Sequential unloading train help

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
kerri1012
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jan 04, 2020 10:19 pm
Contact:

Sequential unloading train help

Post by kerri1012 »

Hi,

I have a basic question :

I have one unloading train station, that 4 trains go to.
Train A, B, C, D.

I want them to unload their cargo in that specific order, all the time, no matter who comes to the stacker first. So if D comes before C, he will have to wait until C unloads his cargo.

What is the simplest way to do it?

Thanks community!!

Greybeard_LXI
Fast Inserter
Fast Inserter
Posts: 122
Joined: Sun Feb 26, 2017 10:48 pm
Contact:

Re: Sequential unloading train help

Post by Greybeard_LXI »

You are going to need stations in the stacker for each train. Train A goes to Stacker Station A before it goes to the unload station.

Then put a rail signal after each of the stations. Start with the signals after B, C and D closed (red).

When Train A arrives at Stacker Station A it will go through to the unload station. The others will wait for their signals to open (turn green).

When Train A is unloaded use circuit conditions to close the signal after Stacker Station A and open the one after Stacker Station B. This allows Train B to move to the unload station. After Train B is unloaded close the signal after Staker Station B and open the one after Stacker Station C.

I'm not good enough with combinators and circuit conditions to give more detail.

I'm curious. Why do you want the trains to unload in a specific order?

kerri1012
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jan 04, 2020 10:19 pm
Contact:

Re: Sequential unloading train help

Post by kerri1012 »

Thx greybeard,

I’m not good enough with conbinators and circuit conditions neither but ill try to do some mileage with what you said. Im still open to blueprints or other ideas or more details Though.

And to your question, ive modified a 373 spm blueprint i found on internet to produce 420 spm and it is feeded by 2 iron plates trains and 2 copper plates trains. They all unload at same station so I need them to alternate from copper to iron. I do not want 2 iron trains to unload then 2 copper...

Thanks for your input!!

wobbycarly
Fast Inserter
Fast Inserter
Posts: 241
Joined: Tue Jan 29, 2019 4:00 am
Contact:

Re: Sequential unloading train help

Post by wobbycarly »

If there are specific trains serving these stations, you could read the train IDs and then set a circuit condition to only enable the specific train to go the station.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Sequential unloading train help

Post by quyxkh »

You can count trains with a positive pulse converter on a rail signal, then wire the pulse to a mod-4 accumulator, feed its output to the waypoint exit signals, have them close if the count's not theirs. Quick demo:


kerri1012
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jan 04, 2020 10:19 pm
Contact:

Re: Sequential unloading train help

Post by kerri1012 »

quyxkh wrote:
Mon Jan 06, 2020 4:06 am
You can count trains with a positive pulse converter on a rail signal, then wire the pulse to a mod-4 accumulator, feed its output to the waypoint exit signals, have them close if the count's not theirs. Quick demo:

Wow quyxkh, you really are a genius!

I works perfectly as I want but I'm afraid I still don't understand why! Could you explain step by step how your setup works?
There is mainly 2 things I don't understand.

First, the rail signal only send red and green signals and for some reason, it is negative? Is that why you multiply it by -1? Why bother?
Second, I don't understand what the last calculator does. Each signal % 4 ?

thanks for your imput!

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Sequential unloading train help

Post by quyxkh »

Combinators take one tick to produce their results, so the each > 0 combinator sees the rail signal's output from this tick and the negated value from the signal's previous tick. If the rail signal hasn't changed, that sum is zero. When it does change, because the signal produces only "1" as values, it'll be the new signal value "1" - the old signal value "0" or the new signal value "0" - the old signal value "1". The decider picks only the > 0 sums, so its outputs are one tick of "1" for each new signal value. The % is wired to those pulses and itself, a feedback-wired combinator is an accumulator, combining new values with previous values and holding the accumulated sum -- as modified by its operation, here the remainder of division by 4, i.e. 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, … which is exactly what you need to pick the right inbound signal.

Post Reply

Return to “Gameplay Help”