Add on_player_preview_blueprint event

Post Reply
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Add on_player_preview_blueprint event

Post by Afforess »

Currently, factorio provides on_player_setup_blueprint and on_player_configured_blueprint.

on_player_setup_blueprint - fires befores the blueprint is created, and includes metadata about the selected area
on_player_configured_blueprint - fires after the blueprint preview gui was shown to the player, and they created the blueprint

There's no event to intercept the blueprint contents at the preview window, before the player accepts (or rejects) the blueprint creation.

This would be useful for mods that modify blueprints on-the-fly. For example, a blueprint mod that automatically changes all small power poles into medium power poles in blueprints, or upgrades transport belts to faster variants, etc. Using on_player_configured_blueprint can achieve the same sort of effect, but players can't preview the changes and it makes the results non-intuitive.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13229
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add on_player_preview_blueprint event

Post by Rseding91 »

I've added LuaPlayer::blueprint_to_setup read for the next version of 0.16 which will let mods change the blueprint that's opened when a player drags a blueprint or book over an area during the blueprint setup event.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Implemented mod requests”