Make source/target inventories of inserters writeable

Post Reply
Allaizn
Former Staff
Former Staff
Posts: 90
Joined: Sat Mar 03, 2018 12:07 pm
Contact:

Make source/target inventories of inserters writeable

Post by Allaizn »

Currently, inserters always figure out by themselves which inventory they interact with, if multiple are possible.
The current behavoir allows us to manipulate this through build order. Consider the following setup:
im2.png
im2.png (652.29 KiB) Viewed 2925 times
The car is positioned in such a way that all four inserters are able to interact with it, but two of them would prefer the beacons if they had the choice.
We can "trick" them into choosing the car anyway by placing the beacons after the car and after the inserters.
It's currently rather tedious to correct the link between inserters and inventories, especially on if you need to check multiple thousands. Note that this is only one example of many: similar interactions happen for belt vs car, assembler vs car, etc., too.

It would be nice if I could write some lua script that does that for me.
This is especially important since the new editor clone tool does not copy this link, which can again be at least fixed by a helper script/mod.

I'm not sure on whether or not any entity should be allowed, or only ones that are actually reachable, but I'd say either is fine, so please implement whatever is easier :)

Rseding91
Factorio Staff
Factorio Staff
Posts: 13149
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Make source/target inventories of inserters writeable

Post by Rseding91 »

If I find time I'll try to see if this can be implemented in a safe way.
If you want to get ahold of me I'm almost always on Discord.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Make source/target inventories of inserters writeable

Post by eradicator »

This would also greatly help modding concepts that have multiple hidden entities overlapping each other (i.e. miniloader). The current behavior as far as i can tell is that inserters dynamically chose a new input inventory if the current one is empty for some time. Would be a great help if that dynamic changing of in/output could be disabled and replaced by script-set forced in/out inventories. (simply disabling the dynamic changing would already be pretty helpful. build-order is easy to manipulate for create_entity.)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Therax
Filter Inserter
Filter Inserter
Posts: 470
Joined: Sun May 21, 2017 6:28 pm
Contact:

Re: Make source/target inventories of inserters writeable

Post by Therax »

Duplicate / additional use case for my request here? viewtopic.php?f=28&t=61442
Miniloader — UPS-friendly 1x1 loaders
Bulk Rail Loaders — Rapid train loading and unloading
Beltlayer & Pipelayer — Route items and fluids freely underground

mulark
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Wed Oct 18, 2017 11:32 pm
Contact:

Re: Make source/target inventories of inserters writeable

Post by mulark »

Here's a bit of lua I made for copying 1 area (ie 1 blueprint + cars) as many times as specified. Basic usage is to start at y = 0 and go north for N tiles that your design will encompass. Supply N to the script. And then run the first command to copy everything except beacons. The second command copies all the beacons. I tried to make both commands in 1 "line" but even when beacons were placed second, it seems like they still were placed in the same tick, so the inserters did not link properly.

https://gist.github.com/mulark/bf2b8f63 ... 773ec2dd85

Post Reply

Return to “Implemented mod requests”