Inserter pickup/dropoff target in case of overlapping entities
Posted: Wed Jun 23, 2021 9:32 pm
Is there a way to specify preferred pickup/dropoff target for an inserter that is pointing at two intersecting entities? Ideally I would like entity prototype to specify inserter_priority (similarly selection_priority) or something like this.
────────────────
FWIW I found a workaround, but it’s far from ideal. I’m setting drop_target/pickup_target at runtime in the following manner:
────────────────
FWIW I found a workaround, but it’s far from ideal. I’m setting drop_target/pickup_target at runtime in the following manner:
- Inserter built ⇒ check entities in inserter pickup_position/drop_position and choose an appropriate target.
- Inserter rotated ⇒ same.
- Length of a configurable inserter has changed ⇒ same.
- One of the potentially overlapping entities built ⇒ find all inserters within a radius of N tiles from it; check if they are pointing at the entity; if yes, choose an appropriate target.
- The last step relies on a hard-coded maximum inserter length, while in reality it’s not limited.
- This is not compatible with other mods that allow changing inserter pickup/dropoff location dynamically, because there is no event for that.
- I’m concerned about performance (haven't tested on a really large base yet).