GlassBricks / StagedBlueprintPlanning

The ultimate Factorio mod for advanced blueprint planning.
GNU Lesser General Public License v3.0
9 stars 2 forks source link

Krastorio 2 inserter drop location compatibility #41

Open alcarithemad opened 4 months ago

alcarithemad commented 4 months ago

In Krastorio 2, it's possible (via hotkey or added UI) to change whether inserters target the near or far side of the destination tile. However, this state is lost when the stage is rebuilt, and not propagated to later stages.

I don't know much about Factorio modding, but the K2 code that does it appears to be here.

Reading the API docs, I think you need to check for allow_custom_vectors on inserter prototypes and, when it's truthy, explicitly track the state of entity drop_position when rebuilding or copying entities to a later stage?

(I don't have it installed anywhere but I would not be surprised to learn this also affects Bob's Adjustable Inserters)

GlassBricks commented 4 months ago

To fix this completely, the Krastorio2 code has to support this a bit. With bob's inserters, a custom event is raised when inserters are adjusted that allows the mod to record the change; there isn't (yet) such an event in the Krastorio2. (The base game also doesn't have an event for inserter position changes).

A workaround for now is to open/close the inserter GUI after changing settings; that should cause an update check.