Auto Deconstruct

by mindmix

This mod marks drills that have no more resources to mine for deconstruction.

Utilities
2 months ago
0.13 - 2.0
321K
Mining

b [no bug] Mod imcompability

a month ago

When using the mod Together with the Omega Drill Mod (https://mods.factorio.com/mod/OmegaDrill) and this mod Attempts to deconstructs the drill the following Message appears in chat "[autodeconstruct|target.order_deconstruction] Error: [53.5, 105.5] failed to order deconstruction on omega-chest"
the Omega Chest is a "hidden" item the Mod places next to the drill so the drill outputs in to a container instead of direct output and under no circumstances can this chest be deconstructed, this mod however doesnt check if its possible to deconstruct an entity and gives the order anyways.
No game breaking or otherwise serious issue but it does get annoying overtime for larger bases.

a month ago

Thanks for the report. There is a setting to add drills and chests to the exclusion list. Let me know what works and I will add it to the defaults.

a month ago

I havent been exactly looking at drills running out of resources but since adding the entity name the message mentioned to the setting i didnt get the error anymore.
as far as i can tell the mod has no hidden entities or anything else causing issues, just that the chest is meant to be part of the drill so it doesnt allow for deconstruction and handles it by it self when removing the drill.
So there shouldnt be anything else needed to be done.

a month ago

I confirmed as well. The only potential problem is that the contents of the chest are deleted by the other mod when the drill is deconstructed. Depending on how full it is that could be a lot of material. I will think about adding a compatibility check to wait until the hidden chest is empty before ordering deconstruction of the drill.

a month ago

yeah, understandable but on the flip side if this mod is used with a mod adding fueled entities to extend earlier stages of the game then sometimes the fuel can be either really valuable in the mods setup or difficult to get and as far as i can see so far nobody has complained about cases where the drill got removed while it still had contents inside.
So i guess you would get away with not having the check but i would still appriciate the extra work to make sure the mod doesnt delete things of value anymore.

a month ago
(updated a month ago)

Fuel and items in the drill's internal buffer are properly picked up by bots when they are deconstructed.

I looked at it some more I really don't want to add a bunch of custom code for the omega drill. If you don't want to lose items inside it, you should add omega-drill to the Autodeconstruct blacklist.

The Omega Drill author can fix this by properly handling deconstruction of their compound entities. This would have two parts: First, listen for on_marked_for_deconstruction of any "omega-drill" and mark the corresponding "omega-chest" for deconstruction as well. This way bots will come to pick up the chest. Second, listen to on_robot_pre_mined of any "omega-drill", and if the omega-chest is still there, give the robot some items from the chest instead of the drill. That will force the robot to return with the items, and make another trip back for the drill, and repeat until the chest is empty.

This is how I handle the "ship engines" in Cargo Ships and it works great. There are even extra steps you can do to add the hidden entities to undo-redo stack entries.

a month ago

I have forwarded your recommendations and this Report to the Author of the Omega Drill, i hope they will take on the responsibility and thanks for looking in to this regardless.

New response