Page 1 of 1
Filtered deconstruction
Posted: Tue May 15, 2018 2:52 am
by DaveMcW
I have a filtered deconstruction planner. What command can I use to apply that filter to an area?
Re: Filtered deconstruction
Posted: Tue May 15, 2018 4:41 am
by eradicator
Without actually selecting an area?
From a quick look at the doc it looks like you'd have to do it manually. I.e. read filters from stack, find_entities_filtered, deconstruct one-by-one.
Re: Filtered deconstruction
Posted: Tue May 15, 2018 5:10 am
by Nexela
Closest solution will be an API requirest on surface.deconstruct_area{area=…, force=…, player=…} to allow passing entity/tile filters and settings (which can be retrieved from an item stack)
Re: Filtered deconstruction
Posted: Tue May 15, 2018 1:44 pm
by eradicator
Nexela wrote:Closest solution will be an API requirest on surface.deconstruct_area{area=…, force=…, player=…} to allow passing entity/tile filters and settings (which can be retrieved from an item stack)
The
documentation on LuaSurface.deconstruct_area has no mention whatsoever of any filtering capability at all.
Re: Filtered deconstruction
Posted: Wed May 16, 2018 1:04 am
by Nexela
Like I said an API request

Re: Filtered deconstruction
Posted: Wed May 16, 2018 1:19 am
by quyxkh
I suppose you could also hook on_marked_for_deconstruction, deconstruct the whole area and cancel_deconstruction() for anything that fails the filters.