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

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Natha
Filter Inserter
Filter Inserter
Posts: 313
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

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

Post 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?
Rseding91
Factorio Staff
Factorio Staff
Posts: 17402
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Thremtopod
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Wed Nov 06, 2024 8:52 pm
Contact:

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

Post 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.
Post Reply

Return to “Modding interface requests”