High Contrast Signals

by GotLag

High-contrast virtual signal icons with fully customisable colours

Tweaks
6 months ago
2.0
145

b Error while loading item prototype [Fixed]

6 months ago

Hi!
With the mod installed https://mods.factorio.com/mod/aai-loaders-stacking-filtering an error appears:
Error while loading item prototype "aai-loader-stacking" (item): Key "icon" not found in property tree at ROOT.item.aai-loader-stacking.icons[2]

I'm guessing it's because of this entry and the current mod changing some value so that other mods can no longer see the original entry:

function Stacking.attach_icon(item, entity)
    table.insert(item.icons, {
        icon = data.raw["virtual-signal"]["signal-stack-size"].icon,
        icon_size = 64,
        scale = 0.5,
        shift = { -16, 16 }
    })
    entity.icons = table.deepcopy(item.icons)
end

I mean, it's possible that other mods that use similar recording options can no longer access the original recording and won't work, even though the error only appeared with this mod.

Could you clarify this point, and maybe make some changes to avoid this option?

6 months ago

That's on me, changing the data of a base game prototype that another mod has made assumptions about. I've updated and moved the changes from data.lua to data-updates.lua so they should be made after any other mods have copied existing prototypes.

6 months ago
(updated 6 months ago)

Fuller explanation: the base game's virtual signal icons are a single layer, so are defined as a field named icon storing a string of the path to the image. I am converting them to layered icon sets, so icon is nil and instead icons contains a table of icon definitions. Then another mod tries to copy the path to the icon file and instead gets nil

6 months ago

Oh, now I understand, thanks for the detailed explanation, this is very useful! This will definitely go into my user experience!

New response