Logistically related objects search function #91
Replies: 2 comments 2 replies
-
It certainly sounds useful. Getting inserter inputs/outputs can be done using it's direction, but it's rather tedius since there's no "built-in" code for doing so. For pipes you can filter just pipe objects, but say you wanted to get all connected pipes, then that requires a slow manual search on the users part. And if you wanted to search for any connected fluid entities (tanks, refineries, chemical plants, assemblers, etc), that becomes a much more complex problem. I guess my next questions would be:
This sounds like a pretty substantial feature request, and might have to end up in version 2.0, but if there's a genuine demand and use for the feature I'd be happy to implement it. |
Beta Was this translation helpful? Give feedback.
-
I think the approach to solving this problem should involve creating a kind of map consisting of a grid similar to Factorio with dynamic state within it, where each cell's parameters will have a link to the influencing source (an object) (though I don't know how to create this link effectively). I can suggest the following option. For example: title_dict_base =\
{
(0, 0): {'collision': "collision with object above cell, link to object",
'push_belt': "link to the 'belt' object (belt (0, 1))",
'pickup_inserter': "link to the 'inserter' object"},
(1, 0): {'collision': "collision with object above cell, link to object"},
(2, 0): {'collision': "collision with object above cell, link to object (electric furnace)",
'drop_inserter': "link to the 'inserter' object"},
(2, 1): {'collision': "collision with object above cell, link to object (electric furnace)"},
...
(4, 1): {'collision': "collision with object above cell, link to object (electric furnace)"},
(4, 0): {'collision': "collision with object above cell, link to object (electric furnace)",
'pickup_inserter': "link to the 'inserter' object"},
...
} You can also add an interaction parameter - power area, drone station network, liquid supply, or any other factor affecting the cell (simplified). Modifications to title_dict_base during blueprint editing can be made through another function that rechecks dependent cells. For example, if an inserter was moved up one cell, updating title_dict_base can be achieved by applying the cell update function specific to that object: I'm a programming cancer so keep that in mind as you review the content I've made. |
Beta Was this translation helpful? Give feedback.
-
Hello, I find myself thinking that the implementation of a large function for retrieving related logistical objects (in a broad sense) would look really cool in your project.
It would be great to have a function for retrieving associated objects. For example, an inserter looks for the object it picks up from and the object it puts into. Similarly, a pipe looks for a pipe it connects to, and so on.
I'm sure someone has already tried to do something like this before me (based on your library), but I couldn't find anything.
Modifications to the Pipe Visualizer and Belt Visualizer demonstrate how this could work (as an example).
What do you think about this?
Beta Was this translation helpful? Give feedback.
All reactions