Event when blueprint is rotated/flipped
Posted: Fri Sep 01, 2023 7:59 am
Hi Devs!
I am creating a mod for configuring pipe flow, very similar interface to Inserter Configuration (https://mods.factorio.com/mod/Inserter_Config), and I have it 99.9% working! that said... I had a massive oversight in that pipes don't have a direction, can't be configured as rotatable at all, and even the ghost entity placed by blueprints with them don't have a rotation. This has been completely fine till now... except for rotating blueprints. Now, the mod Flow Control exists (https://mods.factorio.com/mod/Flow%20Control), and they way that mod works is by creating custom items for each pipe junction type and letting you rotate them, which would obviously work better for blueprints... but there are a handful of limitations and drawbacks of this, such as underground pipes not auto-removing pipes when replacing sections (which I've tested and does work when the entities are pipes!).
If there was an event for when a blueprint is rotated/flipped, and things like "can this blueprint be flipped" could be configured (right now you aren't allowed to flip blueprints with the custom pipes I've added, even though I could easily fix it up if I had the event), all I would really need is the ability to change the name of the entity within the blueprint to place, given which modifications were done to the blueprint.
I would gladly elaborate further or discuss alternative solutions, and would be happy to share the code for the mod as-is! It looks like there is some concept and precedent for exposing a non-trivial amount of blueprint info to lua (https://lua-api.factorio.com/latest/cla ... t_entities), so I'm hoping this request wouldn't be too significant an undertaking
Best!
SafTheLamb
I am creating a mod for configuring pipe flow, very similar interface to Inserter Configuration (https://mods.factorio.com/mod/Inserter_Config), and I have it 99.9% working! that said... I had a massive oversight in that pipes don't have a direction, can't be configured as rotatable at all, and even the ghost entity placed by blueprints with them don't have a rotation. This has been completely fine till now... except for rotating blueprints. Now, the mod Flow Control exists (https://mods.factorio.com/mod/Flow%20Control), and they way that mod works is by creating custom items for each pipe junction type and letting you rotate them, which would obviously work better for blueprints... but there are a handful of limitations and drawbacks of this, such as underground pipes not auto-removing pipes when replacing sections (which I've tested and does work when the entities are pipes!).
If there was an event for when a blueprint is rotated/flipped, and things like "can this blueprint be flipped" could be configured (right now you aren't allowed to flip blueprints with the custom pipes I've added, even though I could easily fix it up if I had the event), all I would really need is the ability to change the name of the entity within the blueprint to place, given which modifications were done to the blueprint.
I would gladly elaborate further or discuss alternative solutions, and would be happy to share the code for the mod as-is! It looks like there is some concept and precedent for exposing a non-trivial amount of blueprint info to lua (https://lua-api.factorio.com/latest/cla ... t_entities), so I'm hoping this request wouldn't be too significant an undertaking
Best!
SafTheLamb