Updated Construction Drones - Forked


Adds ground based construction robots. A repackage the original mod by Klonan. Forked to fix some long-standing issues. Now with quality support

Utilities
8 days ago
2.0 - 2.1
12.6K
Logistic network

g [Fixed] empty-sprite.png not found

5 months ago

hey,

got the following message loading the mod

Failed to load mods: File Construction_Drones_Forked/data/tf_util/empty-sprite.png not found

5 months ago

I can't tell what mod version you were using for this.
The issue should have already been fixed.

5 months ago

i´m using the most recent version 1.1.12

5 months ago

i´m using al lot of QOL-mods

your mod is fine
but if you load it with alle SA-Mods and Teleporters 2.1 i get the message
https://mods.factorio.com/mod/Teleporters_unofficial_2_1?from=search
everything else seems fine
but if these mods are loaded together the message appears

5 months ago

This issue is because both my mod and the teleporters mod reference the same-named file at the same path, which both of our mods contain their own versions of.
It should be fixed

4 months ago

Still getting 'File Construction_Drones_Forked/data/tf_util/empty-sprite.png not found'
With these:
• module-category-defaults (2.2.0)
• skewer_planet_vesta (2.1.23)
• boompuff-agriculture (1.1.1)
• mferran lib (0.7.3)
• panglia_planet (0.5.12)
• Cerys-Moon-of-Fulgora (4.24.13)
• Construchon_Drones_Forked (1.1.18)
• apia (0.3.0) • PlanetsLib (1.25.1)
• StableFoundations (1.6.0)
• nulla (1.0.1)
• Water-Friendly-Walls (2.1.3)
• snouz_space_platform
hull (1.0.2)
• more-quality-scaling (1.7.2)
• Belt_Glow (2.3.0)
• aai-loaders (0.3.0)
• improvement-loaders (1.0.6)
Disbling only constructin drones solves the crash.

3 months ago

Just download the other "Construction Drones" mod, get the "empty-sprite.png" from the same directory, and copy it on this one's zip on your mod folder, and you are gold.

a month ago

^
The last update crashed my game again and forced me to do this again, just a fyi!

"Failed to load mods: File Construction_Drones_Forked/data/tf_util/empty-sprite.png not found"

a month ago

Don't know what would be causing this, because there are zero references to that file in the mod.
So if its trying to pull it, that's either an old version, or some other mod is trying to use it.
It might also just be that you have the original mod installed, you should remove it.

a month ago

Hi! Maybe it's the mod "Eneas"? It's a planet mod that has the same construction drones, and perhaps it's looking for references from this mod that just don't exist to begin with because this is the "fixed" version? Or something like that, that's my two cents! Might be worth it to talk with them.

14 days ago
(updated 14 days ago)

Ok, I got it with the help of AI which sent me on the right track (if this is wrong, I totally shift the blame to AI :-).

What you do resp. Klonan did in https://github.com/daz96050/Construction_Drones/blob/025049fa00cb2fc244ac3c59c66a6e0a154cb3aa/data/tf_util/tf_util.lua#L21 is modifying the Factorio GLOBAL util library, not your local copy. Which surprised me because local util = require("util") looks so local scope to me, but then again, neither do I have deep knowledge of lua nor Factorio.

That's what Google AI said:

Because Lua passes tables by reference, local util = require("util") does not create a copy of the table—it simply creates a local variable pointing to the cached module table stored in package.loaded["util"].

• Data Stage (data.lua, data-updates.lua, data-final-fixes.lua): All active mods share a single, unified Lua state during the data stage. When you modify util.empty_sprite, you are mutating the shared package.loaded["util"] table. Any mod that loads after yours and calls require("util") will receive the same table reference, meaning your custom empty_sprite function will be visible to them (and could overwrite or be overwritten by another mod's version).
• Control Stage (control.lua): Every mod gets its own isolated Lua state at runtime. Mutating util in control.lua only affects files within your own mod's runtime environment and will never leak into other mods.

So when discussing this further, it means that IF you choose to overwrite util functionality, you have to do that in such a way that it remains globally consistent for the whole of Factorio and all mods (in data stage).

What that does mean is that after e.g. Repair_Turret or the old Construction_Drones is loaded and they manipulate util, from there on, if any Factorio mod or code calls util.empty_sprite, it doesn't use Factorio's built in __core__/graphics/empty.png anymore, but uses Repair_Turret's or Construction_Drones's data/tf_util/empty-sprite.png.

Why doesn't this break all over the place? Apparently, that's just a blank 1x1 png (or scaled down from 64x64), and thus it doesn't matter whether it stems from base Factorio or anywhere else, as long as it exists. <aside>Thinking of that, I would be so bold as to claim that this doesn't seem to be built on rock solid ground... since, of course, mod code will be reused by other people. And patching global structures might not be considered to be very nice for other modders... well whatever, hindsight 20/20 and all that.</aside>

That probably also explains why the mod list suggested to be disabled by the error message is so long, I scanned my mods for the usage of util.empty_sprite, and it's used all over the place.

The real kicker for me was realizing, that for the error to appear, that you NEED to have a Klonan mod (like Repair_Turret, which I have, or Teleporters_unofficial_2_1, which grumanov has), that loads BEFORE Updated Construction Drones - Forked - because the vanilla implementation of util.empty_sprite (in Factorio's data/core/lualib/util.lua) doesn't care at all for util.path (in fact, the whole property util.path IS INTRODUCED BY Klonan mods in the first place), it just uses "__core__/graphics/empty.png", no dynamic path at all. But as soon as a Klonan mod with the tf_util business is loaded BEFORE Updated Construction Drones - Forked, util is poisoned by relying on a valid combination of util.empty_sprite and util.path all of a sudden. That obviously makes it insanely hard to track down what's happening, you even might not realize that we're talking about a SHARED UTIL in the first place, and if you don't know that, all debugging is in vain.

So - I believe, if you really want to modify util.path, you HAVE to set util.empty_sprite to a valid location, too. And if you don't want to add an empty png that would seem useless to your mod (and you don't want ALL OTHER MODS loading after yours which depend on a valid GLOBAL UTIL trigger your code), you probably could default to overriding util.empty_sprite with its original definition. Or throwing away the overriden tf_util.lua in total, which honestly I would do, the more I think about it the more reckless it seems, even though without a doubt Klonan had his reasons back in the day. AI provided a lot of interesting "historical" aspects about that which I definitely won't repeat here unvalidated. ;-)

Well, just thought I'd let you know, you can of course do whatever you want with that information. :-) Interestingly enough, Klonan has revived Construction_Drones, but it appears that a lot of work has been done in your Construction_Drones_Forked, so I hope this will keep living. :-)

P.S.: I see you were on the right track with https://github.com/daz96050/Construction_Drones/blob/025049fa00cb2fc244ac3c59c66a6e0a154cb3aa/.github/copilot-instructions.md?plain=1#L58, but apparently it's even more deep, or subtle. IF my AI didn't invent all the stuff I claimed above out of thin air. :-)

14 days ago
(updated 14 days ago)

if you want to remove tf_util, it might look something like that: https://github.com/daz96050/Construction_Drones/pull/5

that's just a suggestion, see my comments in the PR, too.

Thanks for keeping Construction Drones alive! :-)

8 days ago

Fixed now

New response