Auto Deconstruct

by mindmix

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

Utilities
11 days ago
0.13 - 2.0
284K
Mining

b LuaEntity doesn't contain key belt_shape

3 months ago

When playing Krastorio2 the electric miners do not get marked for deconstruction, with the error message: "[autodeconstruct|on_resource_depleted] Error: LuaEntity doesn't contain key belt_shape."
It marked the burner miners for deconstruction before this with no problems. I have not checked if the electric miners mk2 also have this problem. The electric miners output to a normal yellow belt.

I'm giving my modlist just in case it's useful, though I wouldn't think it would be a problem with mod interactions with the other smaller mods.

{
"mods":
[

{
  "name": "base",
  "enabled": true
},

{
  "name": "AutoDeconstruct",
  "enabled": true
},

{
  "name": "blueprint-sandboxes",
  "enabled": true
},

{
  "name": "BottleneckLite",
  "enabled": true
},

{
  "name": "bullet-trails",
  "enabled": true
},

{
  "name": "CleanFloor",
  "enabled": true
},

{
  "name": "extended-descriptions",
  "enabled": true
},

{
  "name": "factoryplanner",
  "enabled": true
},

{
  "name": "far-reach",
  "enabled": true
},

{
  "name": "FasterStart",
  "enabled": true
},

{
  "name": "fcpu",
  "enabled": true
},

{
  "name": "Fill4Me",
  "enabled": true
},

{
  "name": "flib",
  "enabled": true
},

{
  "name": "FNEI",
  "enabled": true
},

{
  "name": "GDIW",
  "enabled": true
},

{
  "name": "GhostOnWater",
  "enabled": true
},

{
  "name": "inserter-throughput",
  "enabled": true
},

{
  "name": "inventory-repair",
  "enabled": true
},

{
  "name": "Krastorio2",
  "enabled": true
},

{
  "name": "Krastorio2Assets",
  "enabled": true
},

{
  "name": "MathCoProcessor",
  "enabled": true
},

{
  "name": "Milestones",
  "enabled": true
},

{
  "name": "more-minimap-autohide-017",
  "enabled": true
},

{
  "name": "PickerDollies",
  "enabled": true
},

{
  "name": "PowerPole32",
  "enabled": true
},

{
  "name": "pushbutton",
  "enabled": true
},

{
  "name": "QuickMapTag",
  "enabled": true
},

{
  "name": "railway-motor-car",
  "enabled": true
},

{
  "name": "RateCalculator",
  "enabled": true
},

{
  "name": "RemoteConfiguration",
  "enabled": true
},

{
  "name": "Robot_Battery_Research",
  "enabled": true
},

{
  "name": "show-max-underground-distance",
  "enabled": true
},

{
  "name": "solar-sails",
  "enabled": true
},

{
  "name": "Squeak Through",
  "enabled": true
},

{
  "name": "start-alt",
  "enabled": true
},

{
  "name": "stdlib",
  "enabled": true
},

{
  "name": "Teleporters",
  "enabled": true
},

{
  "name": "textplates",
  "enabled": true
},

{
  "name": "TimeTools",
  "enabled": true
},

{
  "name": "train-signal-visualizer",
  "enabled": true
},

{
  "name": "Train_Control_Signals",
  "enabled": true
},

{
  "name": "underground-pipe-pack",
  "enabled": true
},

{
  "name": "UsefulCombinators",
  "enabled": true
},

{
  "name": "VehicleSnap",
  "enabled": true
},

{
  "name": "Waterfill_v17",
  "enabled": true
},

{
  "name": "WideChests",
  "enabled": true
},

{
  "name": "WireShortcuts",
  "enabled": true
},

{
  "name": "YARM",
  "enabled": true
}

]
}

3 months ago

Thanks for the report. Could you share the save file as well? That would be the fastest way for me to fix it.

3 months ago

I'll do my best to get you that during the next 24 hours.
Oh, stupid me forgetting to add what version of Factorio it was and such. I'll package up everything and get you that.

3 months ago

Most everything except for the bin and data should be in this zip file: https://drive.proton.me/urls/72JK967Y0R#4LkW7Dy2YJCK
Factorio v. 1.1.80 if I got everything correct, so that would be the version you should download to verify the bug, though I don't know if a later version would no longer have the bug.
Once I've got confirmation that you've received the file I'll probably remove it.

3 months ago

Thanks for the file. That's a very old version of the game. The "belt_shape" parameter doesn't exist in that version, so that's why the error shows up. I don't support older stable versions; you can turn off the "remove unused belts" setting or upgrade your Factorio version.

3 months ago

The setting "also mark unused belts for deconstruction (experimental)" that I'm assuming you're talking about hasn't ever been turned on in my game at all.

3 months ago

Isn't there an option to say that the newer versions of AutoDeconstruct needs a specific version or higher in the mod files for the game. So then the older version of AutoDeconstruct that worked fine on 1.1.80 wouldn't get the message to update the mod and then not work as well as it did previously. I'm not sure if it would also make it so older versions of Factorio would automatically only show the version of AutoDeconstruct that is marked as compatible with the version, but that would've made sense to me with how Wube seems to have set it up.

3 months ago
(updated 3 months ago)

Please check again when you load your save file, the default value might have glitched for some reason. That error message is impossible if the belt code doesn't run. When I loaded your save in 1.1.109 it was enabled.

I wasn't aware that there was an incompatibility; you're right that I should increase the required base version.

3 months ago

I double checked, and it doesn't show as enabled. https://drive.proton.me/urls/KYT1RYFJGM#UlcDeu8kwx0z is an image of how it's set up on my installation, and https://drive.proton.me/urls/0TVSJKT62G#ArTtLhBPHDKW shows the error showing up.
I'll try to enable and then disable it again to see if that changes it.

3 months ago

Yeah, no dice. Trying to enable and then disable the setting still gives the same error.

3 months ago

Well at least I know how to fix that. There is data in the global table that needs to be deleted when the setting is disabled. Leave your package up so I can download it again and test it.

Right now the best solution for your game is to disable AutoDeconstruct, liad the game, save the game, then download and enable AD version 0.3.16. That one is full compatible with 1.1.80.

3 months ago

So I guess version 0.4.0 and newer of AutoDeconstruct is incompatible with any versions of Factorio lower than 1.1.100 released 2023-12-04. At least if I understand it correctly with both how 1.1.100 of Factorio "Added LuaEntity::belt_shape read." and AD only using that in versions 0.4.0 and newer (or did I misunderstand?)

3 months ago

Ooops, I deleted the upload of the game files I had. Thankfully it was still in the "trash" and I have restored it with the same URL to get it.

Thanks for the help with what to do to downgrade to 0.3.16, and which version to go for. Sorry for the little bit of headache, but at least it may be somewhat useful information?

3 months ago

Yes what you guessed is correct. No worries! It totally didn't occur to me to check older versions or that the API key m8ght have been recently added.

3 months ago

I just uploaded a new version with the correct dependency, and deleted the other versions of 0.4.x so no one else will have this issue :D

3 months ago

Hey, thanks so much. Yeah, when I looked into the in-game mod portal now it just shows version 0.3.16 for AD in my game.
Amazing help from you. Thanks again.

New response