Auto Deconstruct

by mindmix

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

Utilities
5 months ago
0.13 - 1.1
241K
Mining

b [Fixed] Periodic Error

2 years ago

I get error message often on while playing. Not sure what causes them and miners are still marked for deconstruction.

[autodeconstruct|on_resource_depleted] Error: AutoDeconstruct/autodeconstruct.lua: 192: attempt to index field 'last_user' (a nil value)

2 years ago

the line is related to the construction of pipes if you deconstruct a miner using fluid.
the error happens if you try to deconstruct a drill that has no "last_user"
can you explain how you build the offending drill(s)?
It is simple to prevent this error with an additional check, but it would help to understand the root cause first

2 years ago

I use the mod Outpost Planner for 1.1 (https://mods.factorio.com/mod/OutpostPlanner1-1) to generate the layout of miners, because I'm lazy. However, that just places ghost entities for you. Then either my personal roboport bots or construction bots from the base's logistic grid actually place the real entities. If the real entities inherit their last user from the ghost entities and if Outpost Planner doesn't properly assign anyone to that then I could see that being a problem.
I'm also playing this in multiplayer with 1 other player who also places miners this way.

2 years ago
(updated 2 years ago)

I have looked into the Outpost planner code a bit and on first glance it does seem like it really omits setting last_user...

It might take a bit of time till I'll provide a pull request to mindmix to fix this, as I am rather busy.

In the meantime you should be able to help yourself by replacing line 192 in autodeconstruct.lua "local drillForce = drill.last_user.force" with "local drill.force"

2 years ago

Having the same issue, I've built mine with https://mods.factorio.com/mod/Companion_Drones mod

2 years ago

https://github.com/softmix/AutoDeconstruct/pull/10 just waiting for confirmation and integration from mindmix

2 years ago

Made a release, much appreciated!

New response