Entity.order_deconstruction mark only
Posted: Wed May 31, 2017 10:21 pm
For an upcoming mod of mine which speeds up chest/container deconstruction by also utilizing available logistic bots instead of only construction bots,
it would be nice to be able to only mark an entity for deconstruction, so that it can no longer be fast replaced by the user and its deconstruction must
be cancelled prior to interacting with the entity again.
In the mod's case, I fast replace the existing chest/container by one that has logistic_mode = "active_provider", effectfully calling available logistic bots
to clear out the inventory, unless of course, I call order_deconstruction(...) upon it.
The rationale behind this is, that when I order deconstruction of an entity, only construction bots will be ordered to clear out the chests/containers
inventory. Marking it for deconstruction would not do such thing, it would instead decorate the entity with the "deconstruction decal" and make it
behave as any other entity currently under deconstruction. Yet, no construction robots will be called and the entity behaves just like normal.
I can then also use the deconstruction planner to remove the deconstruction mark, causing the on_canceled_deconstruction event to fire.
So, I would propose a change to the Entity's api, namely Entity.mark_for_deconstruction(force).
it would be nice to be able to only mark an entity for deconstruction, so that it can no longer be fast replaced by the user and its deconstruction must
be cancelled prior to interacting with the entity again.
In the mod's case, I fast replace the existing chest/container by one that has logistic_mode = "active_provider", effectfully calling available logistic bots
to clear out the inventory, unless of course, I call order_deconstruction(...) upon it.
The rationale behind this is, that when I order deconstruction of an entity, only construction bots will be ordered to clear out the chests/containers
inventory. Marking it for deconstruction would not do such thing, it would instead decorate the entity with the "deconstruction decal" and make it
behave as any other entity currently under deconstruction. Yet, no construction robots will be called and the entity behaves just like normal.
I can then also use the deconstruction planner to remove the deconstruction mark, causing the on_canceled_deconstruction event to fire.
So, I would propose a change to the Entity's api, namely Entity.mark_for_deconstruction(force).