Let item-request-proxy target specific inventory/grid

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 638
Joined: Sun May 07, 2017 10:16 am
Contact:

Let item-request-proxy target specific inventory/grid

Post by ickputzdirwech »

Problem
A cargo wagon with an equipment grid and an item-request-proxy that requests some equipment. The equipment is inserted into the cargo inventory and not the grid.

Workaround
I register the item-request-proxy for on_entity_destroyed and move the equipment into the grid as soon as the item-request-proxy is fulfilled.

Proposed solution
A way to tell an item-request-proxy to target or at least prioritise a specific inventory/grid.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

curiosity
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Let item-request-proxy target specific inventory/grid

Post by curiosity »

This requires vehicle equipment grid to be blueprinted alongside the vehicle. Else you would be throwing a knapsack problem at the devs.

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 638
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Let item-request-proxy target specific inventory/grid

Post by ickputzdirwech »

curiosity wrote:
Sat May 15, 2021 4:17 pm
This requires vehicle equipment grid to be blueprinted alongside the vehicle.
Mmh, can you explain to me why that would be necessary :?:
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

curiosity
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Let item-request-proxy target specific inventory/grid

Post by curiosity »

ickputzdirwech wrote:
Sat May 15, 2021 4:28 pm
Mmh, can you explain to me why that would be necessary :?:
See the second sentence.

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 638
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Let item-request-proxy target specific inventory/grid

Post by ickputzdirwech »

Sorry I just don’t get it. I create an item-request-proxy by script and tell it which entity it should target. Additionally I would like to be able to specify which inventory of that entity the item-request-proxy should target. What does that have to do with blueprinting equipment grids?
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

curiosity
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Let item-request-proxy target specific inventory/grid

Post by curiosity »

Equipment grids have layout. To put something in you need to determine where to put it. A knapsack problem (in this case, more precisely, a packing problem) is a problem, in which you are given items with some metric (in this case their dimensions in the grid) and "value". You are required to maximize the total value, in this case all items fitting into the grid. Which itself poses a problem of which item to pick if there are for some reason more items than the grid can contain. This class of problems is very hard and time-consuming to solve, and in most cases not fit for real-time computation (e.g. in a game).
Last edited by curiosity on Mon May 17, 2021 10:09 pm, edited 1 time in total.

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 638
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Let item-request-proxy target specific inventory/grid

Post by ickputzdirwech »

Ok I now understand what you mean. But that's a different issue. I'll explain why:

See the behaviour of a locomotive with a grid. Requested equipment gets inserted directly into the grid since it has no other place to go. True, right now requests for equipment might fail, because previous ones didn't get inserted into the grid in the optimal way. This is the problem you are fearing: it already exists.

For the cargo wagon on the other hand it's not even possible to tell the robots to insert the equipment into the grid, since they will always try and insert it into the cargo inventory first. So even if the devs would fix the "knapsack problem" the issue I am having would still exist. Therefore it's a different problem (but I wouldn't mind blueprintable grids of course).
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

Post Reply

Return to “Modding interface requests”