Intercept and modify blueprint creation?

Place to get help with not working mods / modding interface.
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 720
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Intercept and modify blueprint creation?

Post by Earendel »

If you use a simple-entity for something (e.g: render_layer = floor) there is the problem that you can't blueprint it because it does not have a force. You can have a placeable entity that gets swapped for an invisible blueprintable entity and a visible simple-entity to get around the problem, but it creates another problem in that the invisible entity ends up in the blueprint but you can't see it - it's invisible.

A fix would be to intercept the blueprint creation and replace any of the invisible versions with the placeable versions.

I get that there's probably an way of editing the blue print once it has been made into an item, but the intercept needs to be before that. It should be in (or before) the blueprint creation screen where you can see what will end up in the blueprint. I was hoping that the on_player_selected_area event might allow me to swap entities to placeable version AS the blueprint was created and then swap them back 1 frame later, but it seems that event only applies to selection tools but not blueprints.

Has anyone seen this done of have any ideas?
Rseding91
Factorio Staff
Factorio Staff
Posts: 15997
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Intercept and modify blueprint creation?

Post by Rseding91 »

There's no event for blueprint creation.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Intercept and modify blueprint creation?

Post by aubergine18 »

@Earendel try the Creative Mode 2.0 beta (download via forums, its in a spoiler at bottom of OP) and enable all the Modding > Events options. While there might not be specific event for blueprint stuff, there might be other events that happen either side, and that would allow your mod to activate player-specific per-tick state checking for a constrained period of time.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Modding help”