define.events.on_player_used_blueprint

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Honktown
Smart Inserter
Smart Inserter
Posts: 1026
Joined: Thu Oct 03, 2019 7:10 am
Contact:

define.events.on_player_used_blueprint

Post by Honktown »

Unless I'm mistaken, there's no simple event for when a player used a blueprint. I'd be looking for:

player_index
blueprint: the table of the entity they used, or name/identifying info I could look for elsewhere. I could check the cursor stack if I had the event
position: position would be where they clicked - I'd have to find the bounding box of the blueprint in question if not provided.
area: if the bounding area could be given (in surface dimensions or not). Lazily calculated so only when a mod is subscribing to the event does it get calculated.

For now I have to do a bunch of shenanigans with on_built_entity if I want to see if a player constructed something with a blueprint, and find all the entities contained within it.

There's already events for when a player selected an area to make blueprint, player confirmed a blueprint, and player used a deconstruction planner, so nothing when a player used a blueprint stands out a bit
I have mods! I guess!
Link

Post Reply

Return to “Modding interface requests”