Updating blueprints cannot be modified by mods

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
SilentStorm
Inserter
Inserter
Posts: 27
Joined: Sun Jul 09, 2017 9:19 am
Contact:

Updating blueprints cannot be modified by mods

Post by SilentStorm »

There are two connected issues here when editing an existing blueprint via the "select new contents" button.

1) After the selection is done the blueprint is already updated and has already been saved, despite the UI suggesting the changes need to be saved and there being a close button in the top right that has a tooltip of "Cancel" suggesting one can restore the blueprint after having selected the wrong area when updating.

2) The LuaAPI does not allow any access to the modified blueprint. Two events are raised, first `on_player_setup_blueprint` is raised as soon as the selection is done, then `on_player_configured_blueprint` is raised after the player clicks the "Save blueprint" button (and only then, as in it does not get called when using the ESC key or the X button in the top right).
The major issue is that when `on_player_setup_blueprint` is raised `is_blueprint_setup()` returns false and it does not allow reading the entities of the blueprint using `get_blueprint_entities()`. Which in and of itself is pretty normal for setting up blueprints as that is also the case when creating a brand new blueprint. However afterwards when `on_player_configured_blueprint` is raised, the blueprint the player is holding is presumably already destroyed as the cursor_stack.is_valid_for_read returns false, since when updating blueprints the finished blueprint is not placed in the players hand, as it is when creating a brand new blueprint.
Effectively that makes it so that there is no way to tell which blueprint was modified or do any updating a mod may want/have to do to the blueprint.

curiosity
Filter Inserter
Filter Inserter
Posts: 400
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Updating blueprints cannot be modified by mods

Post by curiosity »


Post Reply

Return to “Modding interface requests”