Page 1 of 1

[2.0.72] set_blueprint_entities makes the cutted entities forget their external wire connections

Posted: Sat Nov 01, 2025 8:29 pm
by Natha
Relating to https://www.factorio.com/blog/post/fff-402. When using set_blueprint_entities, even without modifying anything, it forgets those wire connectiong going to external entities.

Code: Select all

script.on_event(defines.events.on_player_setup_blueprint, function(event)
	local item = event.record or event.stack
	item.set_blueprint_entities(item.get_blueprint_entities())
end)
Can we have the possibility to read and preserve those outgoing connections when using the cut tool?

Re: [2.0.72] set_blueprint_entities makes the cutted entities forget their external wire connections

Posted: Sat Nov 01, 2025 8:34 pm
by Rseding91
Thanks for the report however when you do what you’re doing you are functionally deleting and re-creating the entire blueprint. The game has no way to know the entities you replaced the contents with are “the same”.

As for reading the external connections, that can likely be done through a new API, but would go into modding interface requests.

Re: [2.0.72] set_blueprint_entities makes the cutted entities forget their external wire connections

Posted: Mon Jul 06, 2026 1:32 pm
by Thremtopod
+1

It would be very useful to have some way to preserve external wire connections when manipulating blueprint entities. I have two use-cases: always copying ammo inventory for a modded turret; and "sanitizing" blueprints (replacing hidden variants of entities/recipes with their regular versions) so that they're durable across different saves and/or different mod settings. My current workaround is to just skip this logic for blueprints created with the cut tool.