I try to build a combinator, which emits the ghosts in specific area as signals. My idea is to inital count the entites with find_entities_filtered and then modify the signal if ghosts are placed or removed. I listen to the following events:
Code: Select all
game.on_event(defines.events.on_built_entity, place)
game.on_event(defines.events.on_robot_built_entity, place)
game.on_event(defines.events.on_preplayer_mined_item, remove)
game.on_event(defines.events.on_robot_pre_mined, remove)
game.on_event(defines.events.on_entity_died, remove)
Thanks,
Gerhard