Page 1 of 1

define.events.on_player_used_blueprint

Posted: Wed Dec 18, 2019 1:18 pm
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