Supply train: early inserters failure

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
TacoCat
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Mar 09, 2020 5:12 pm
Contact:

Supply train: early inserters failure

Post by TacoCat »

Playing version: 0.18.10-1
Mods: base 0.18.10
Scenario: freeplay

I'm having a bit of a conundrum here. I'm trying to setup a supply train to pick up a certain number of items before moving out of the supply station, however I'm noticing that inserters will perform an operation before they get a signal from the circuit. So this is what I have:

Train: 1 loco + 1 wagon
The loco has the filters setup to check for cargo contents before moving on. For example: 500 rail, 300 electric mining drills, 50 medium electric poles, etc., basically a setup for a remote resource patch build.

Image

Supply station: Several boxes, each one containing the necessary items to reload the train. Each box has its own inserter. The station has the 'Read train contents' enabled and it's linked to all the inserters. Each individual inserter is set up to check for the required amount needed on the train. For example, the inserter for rails is configured as enabled while rail < 500 and a stack size of 1 (to avoid it going over the threshold.)

Image

This works great, IF the train shows up with less items than the filter is set up for. For example if it shows up with anything less than 500 rails. However, if it were to show up with 500 rails already on it, the logic will fail. As soon as the train shows up, the inserts will add 1 item on to the train, making the count 501, and then stop. This then makes the train's filtering fail because it's setup to look for exactly 500 items, not 501.

Image

Setting the train to move on if the item is at 'greater or equal to' will work, but this means that over time, it will have more items than I want on it because the inserters will always insert 1 item as soon as the train arrives, before the station sends the signal with the train contents. So it seems the inserters are doing something before reading the circuit signal or before the station is able to send it, I don't know which comes first.

Like I said, this works if the train either has less than the amount requested, or if I set the loco filter to 'greater or equal to' with the caveat that it will eventually have more items than necessary. Otherwise it fails and the train gets stuck at that reload station. Can someone else verify this and is there a better solution?
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2977
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Supply train: early inserters failure

Post by boskid »

Most likely same "not a bug" as this: 75006
TacoCat
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Mar 09, 2020 5:12 pm
Contact:

Re: Supply train: early inserters failure

Post by TacoCat »

boskid wrote: Mon Mar 09, 2020 6:26 pm Most likely same "not a bug" as this: 75006
Oh good, I'm not insane then .... yet. And I did think of checking for the train being present first before activating the inserters but as the other OP pointed out, it felt like a hack. But I understand the tick order and what not here. Thanks!
jdtitans
Burner Inserter
Burner Inserter
Posts: 10
Joined: Tue Mar 12, 2019 12:20 am
Contact:

Re: Supply train: early inserters failure

Post by jdtitans »

It didn't sound like you were trying to report a bug, just trying to figure out how to make this work.

A very easy way to set up your supply train is to reserve the bins in your cargo car for a particular item. Do this by middle clicking (default) and selecting the item you want reserved there. In your case, you only have 23 slots to reserve, but you'll figure out other things you want there. In the mean time, you can reserve the space for stuff you aren't loading (like pistols or fish). Then you'll load exactly the amount you want and you won't even need circuits.

One negative of this (that you are bypassing by having one inserter per item) is that sometimes the inserter will have an extra object that it can't put down. If you're trying to load multiple item types with a single inserter, this could lock up that inserter and the other item(s) won't load.
Post Reply

Return to “Gameplay Help”