Train Unloading

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
realm174
Fast Inserter
Fast Inserter
Posts: 106
Joined: Sat Apr 02, 2016 12:32 pm
Contact:

Train Unloading

Post by realm174 »

Image below shows my unloading/waiting area. Basically, the 4 vertical tracks are where the trains will go to unload their cargo. They are all named identical so the trains will go to the first available one. Once done unloading, they go to a designated waiting area to the south (the 4 horizontal), where they will wait for their signal to go green before proceeding. Each waiting lane is for a specific ore (Iron, Copper, Coal, Stone). Whenever things get low, the appropriate signal goes green, the train goes to pick up goods.

My problem comes with the unloading portion. The rule for the train is to wait until cargo is empty. Where this occasionally becomes a problem is when the chests aren't unloading fast enough. The previous train would be gone already, the next train comes up that lane and can't unload its cargo since the chests are still (partially) full. Here's the image, my idea on how to solve this is below.

Image

What I am wanting to figure out is if there's a way to keep track of the total amount of items in the unloading chests, per row, so that I can turn a signal on/off at the entrance, hence redirecting a train to an empty unloading area. I am currently using red wiring to figure out the total of each ores through the system, for the south waiting area. That's fairly easy, I tell the signal based on specific ore and amount. Is there a way to use a similar method to find out the total amount of items in 4 chests for the unloading area, keeping in mind that a chest can contain (and often will) more than one type of item?

thanks!

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Train Unloading

Post by DaveMcW »

Use green wire to count the 4 chests?

realm174
Fast Inserter
Fast Inserter
Posts: 106
Joined: Sat Apr 02, 2016 12:32 pm
Contact:

Re: Train Unloading

Post by realm174 »

DaveMcW wrote:Use green wire to count the 4 chests?
Sure, but what condition can I use on the signal? My current ones would be like "Turn signal red if Iron Ore > 10k". Is there a way I can make it say "Turn signal red if number of all items, whichever they are > 1k" ?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Train Unloading

Post by DaveMcW »

You need an arithemetic combinator to add them up.

Each + 0 → A

Then the condition is simply:

A > 1k

realm174
Fast Inserter
Fast Inserter
Posts: 106
Joined: Sat Apr 02, 2016 12:32 pm
Contact:

Re: Train Unloading

Post by realm174 »

Thanks Dave! I got it to work. I probably made it way more complicated than it needs to be, but at least it's functional for now, until I get a chance to read/view some good tutorials on it.

Thanks again, much appreciated!

Post Reply

Return to “Gameplay Help”