How do I not overfill a box? Or a railway cart, for that matter

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Laie
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Fri Dec 25, 2020 6:18 pm
Contact:

How do I not overfill a box? Or a railway cart, for that matter

Post by Laie »

I want to fill a train with construction materials. For example, one wagon is supposed to carry two stacks each of all kinds of splitters and underground belts, also 4 stacks each of several types of inserters, plus some odds and ends. I went over all the item slots on the wagon and assigned them a role.

I thought I could source all that from a single requester chest, and that's where the trouble starts: With a hand size of 12, it would insert (say) 96 items just fine, but at 100 items the wagon's slots are filled, and the inserter is left hanging there with 8 items in hand, waiting for room in the destination. There may still be a plethora of items that could be loaded into the wagon, but the inserter won't move any more.

It tried to work around the issue by setting the hand size to 10, and having a decider combinator that will lock the inserter if "everything (red star) < 10". That way, the inserter is supposed to only move when it can pick up a full hand. This works most of the time, except when...
  • some item count reaches zero. At that point the decider will allow the inserter to move because everything that is in the box is also present in sufficient amount.
  • a logistic bot delivers a small amount of the previously missing items
  • the inserter picks them up immediately
  • the decider sends the locking signal, but too late: the inserter has already picked up less than a handful.
    [

...and besides, that scheme requires that I only ever pick up multiples of ten items from the train. If I find myself with (say) four pump jacks left in my pocket, I can't just dump them back into the construction train or it will stall at the next loading procedure.

Short of setting hand size to 1 or using a dedicated chest for every material: what can I do? The core problem is that, if the receiving chest (or train) will accept any amount of an item, the inserter will pick up however much it can, without regard for the amount it can drop on the other side.

User avatar
Nosferatu
Fast Inserter
Fast Inserter
Posts: 228
Joined: Fri Jan 20, 2017 4:48 pm
Contact:

Re: How do I not overfill a box? Or a railway cart, for that matter

Post by Nosferatu »

You have to make sure that inserters only input goods if what is requested is above their stacksize. My solution is here:
viewtopic.php?p=514368#p514368
Last edited by Nosferatu on Sun May 09, 2021 4:55 pm, edited 1 time in total.

Zanthra
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: How do I not overfill a box? Or a railway cart, for that matter

Post by Zanthra »

You can read train contents, multiply by -1, add to a constant combinator, and removing values below 0. to get items needing loaded, then set filter inserters based off that. Then you just need some spare space in the wagon for the little bit of overflow. The inserter won’t get stuck because the available slots is higher than the number of slots for the requested load, so there is room for the overflow.

astroshak
Filter Inserter
Filter Inserter
Posts: 597
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: How do I not overfill a box? Or a railway cart, for that matter

Post by astroshak »

Eh ... personally, I just use one Requestor Chest per item. So, if I want to load a building train with 100 Splitters, 100 Undergrounds, and 400 Belts, I’d use three Requestor Chests, one for each. With slot locking in the destination Cargo Wagon I cannot overload the train with too many Undergrounds; but because each inserter only needs to hold one item, I do not run into the issue of too much stuff in hand.

That said, have you tried setting the stack size to 1? It will take longer to load (though you’ve given up on some loading speed by using one chest instead of one per item) but should dramatically reduce the instances of the issue you are encountering.

Serenity
Smart Inserter
Smart Inserter
Posts: 1000
Joined: Fri Apr 15, 2016 6:16 am
Contact:

Re: How do I not overfill a box? Or a railway cart, for that matter

Post by Serenity »

It can be done, but I don't think it's worth the effort. One wagon can fit more than enough requester chests to use one per item type

User avatar
NotRexButCaesar
Smart Inserter
Smart Inserter
Posts: 1121
Joined: Sun Feb 16, 2020 12:47 am
Contact:

Re: How do I not overfill a box? Or a railway cart, for that matter

Post by NotRexButCaesar »

You can filter the wagon slots by middle clicking on them.
—Crevez, chiens, si vous n'étes pas contents!


Laie
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Fri Dec 25, 2020 6:18 pm
Contact:

Re: How do I not overfill a box? Or a railway cart, for that matter

Post by Laie »

My workaround for the time being: a filter inserter and reading the stack inserter's hand contents. If there's less than a handful, the stack inserter is presumably stuck and the filter inserter removes the item in question, one at a time, into a provider chest.

Still prone to some weird behaviour (most notably, items can move in circles until more arrive) but seems to do the right thing... eventually.

Post Reply

Return to “Gameplay Help”