Finer control of inserter pickup from belts

Place to get help with not working mods / modding interface.
Post Reply
PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Finer control of inserter pickup from belts

Post by PFQNiet »

Is it at all possible fine-tune where inserters pick up from belts?

In particular I have modded inserters with custom vectors picking up from the end of a belt, and currently they pick up preferentially from the left lane, even when the custom vector positions the pickup location over the right lane. I'd also like for the inserter to wait until the item is closer to the end of the belt, rather than grabbing it the instant it crosses the tile border.

Are there any options that allow for this, or is this behaviour hard-coded?

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

Re: Finer control of inserter pickup from belts

Post by eradicator »

Last time I tried pickup lane preference via vector worked. Maybe you set it wrong? It's not the most intuitive system as the preferred lane also depends on the relative position of the inserter to the belt. Item chasing behavior is hardcoded as far as i know.
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.

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Finer control of inserter pickup from belts

Post by PFQNiet »

Well, to be more specific, here's some ascii art of a belt:

Code: Select all

 _________
/         \
|    x    |
| \     \ |
|  >     >|
| /     / |
|    x    |
\_________/
So the belt is facing right, there are two inserters in the same tile to the right of it with the goal of each one picking from a preferred lane, indicated with x in the graphic above. Their custom vectors are set to the belt's position +/- 0.25 vertically, ie. directly over a lane. Would it perhaps help to set the vectors closer to +/- 0.4 instead?

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

Re: Finer control of inserter pickup from belts

Post by eradicator »

The graphic is a bit difficult to understand... are you saying both inserters are in the same tile as the belt? Maybe a look at miniloaders code would help?
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.

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Finer control of inserter pickup from belts

Post by PFQNiet »

Both inserter are on the next tile to the right, but as far as I'm aware it shouldn't matter since it should just be the vectors that count. But I'll have a look at Miniloaders, good call.

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Finer control of inserter pickup from belts

Post by PFQNiet »

After looking into it, it seems both Miniloaders and Editor Extensions use the same offset of +/-0.25 as I am. This isn't an issue for EE because they just load into a deleting infinity chest so never have a lane back up. I imagine with Miniloaders if a machine just needs a few items then it'll pull from one lane as well. Guess I'll just have to deal with that!

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

Re: Finer control of inserter pickup from belts

Post by eradicator »

PFQNiet wrote:
Mon Aug 02, 2021 1:12 pm
After looking into it, it seems both Miniloaders and Editor Extensions use the same offset of +/-0.25 as I am. This isn't an issue for EE because they just load into a deleting infinity chest so never have a lane back up. I imagine with Miniloaders if a machine just needs a few items then it'll pull from one lane as well. Guess I'll just have to deal with that!
Hm...my memories are vague. I think I might have solved it by placing the inserters always at least one tile to the side so that they're never in parallel with the belt (perpendicular or diagonal). If the inserters are invisible / don't have collision boxes they can be anywhere without it mattering much.
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.

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Finer control of inserter pickup from belts

Post by PFQNiet »

After some experimenting, I confirmed that placing the inserters exactly alongside the belt would correctly pull from the near lane, but any kind of diagonal grab would pull from the left lane in the direction of travel.

I've managed to wrangle this successfully! Thank you for the pointers.

Post Reply

Return to “Modding help”