What is the proper way to respond to a blueprint being placed? I would like to have a table of ghosts to do stuff with.
Would this be done as just a large number of entity creation events where the entity is a ghost? If so, how would I tell the difference between an item holding a single entity, or shift-clicking to place a ghost?
What about copy-paste? Is this just a temporary blueprint that can be handled in the same way?
Detect placement of blueprint
Re: Detect placement of blueprint
Yes. If you need all ghosts in one table, you can collect them in on_built_entity, store them in a table, and process/delete the table in on_tick.
Check player.cursor_stack to see what they used.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Detect placement of blueprint
You should keep seperate tables for each player in case several players build simultaneously.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.