Get only deconstruct entities using find_entities_filtered
Get only deconstruct entities using find_entities_filtered
I was wondering if there was a way to use find_entities_filtered to find only entities that need to be deconstructed. I know that I could look through all of the entities and see if the to_be_deconstructed flag is set but this approach falls apart when the player is using something like the long reach mod. There could be thousands of entities to look through in that case. Also it doesn't have to be find_entities_filtered but it should efficiently get a list of entities that need to be deconstructed.
Re: Get only deconstruct entities using find_entities_filtered
Depending on the specific use case http://lua-api.factorio.com/latest/even ... nstruction might be an alternative?
You could collect them in some global.variable and then process them in on_tick, and unregister the on_tick handler afterwards
You could collect them in some global.variable and then process them in on_tick, and unregister the on_tick handler afterwards
Re: Get only deconstruct entities using find_entities_filtered
Thank you for the reply. That is an alternative true, but I was more curious to know if there was some equivalent to find_entities_filtered that would get entities for deconstruction as a filter. Seems odd we can get ghost entities specifically but we can get deconstruction entities without incurring a large performance hit if you are playing with a mod like long reach. You can track them as they happen true, but it is a little more complicated than just saying "find me all deconstruction entities within reach" like you can with ghost entities using find_entities_filtered.