Page 1 of 1

Looking for some help to fix this.

Posted: Tue Aug 09, 2016 4:13 pm
by SoulForge
There was a multi-minables mod for 12.35 that still works in 13+.

However for some reason I can't figure out it won't work for certain additional mod ores. Seems to work for bobs mods but not 5DIM.

Code: Select all

multiplier = 10

for _, res in pairs(data.raw.resource) do
    if not res.category --crude-oil has "basic-fluid" here, for ores this is nil
    and res.minable then
        if res.minable.result then
            if res.minable.count then
                res.minable.count = res.minable.count * multiplier
            else
                res.minable.count = multiplier
            end
        elseif res.minable.results then
            for _, result in pairs(res.minable.results) do
                result.amount = result.amount * multiplier
            end
        end
    end
end
Thanks to prg for simplifying the original mod in the past. And Bokrug as the original author of the mod/idea.

Re: Looking for some help to fix this.

Posted: Thu Aug 11, 2016 2:19 am
by Mooncat
I checked 5dim's ore mod and the original multiplied minable mod. Are you using data.lua? If so, this is the problem.

5dim adds its ores in data-updates.lua, which is executed after data.lua in all mods. Because your mod is changing existing items including those from other mods, I think it is better to place it in data-final-fixes.lua instead, which is executed after data-updates.lua.
For details, check this: https://wiki.factorio.com/index.php?tit ... _Lifecycle

If there is compatibility problem for some specific mods, better dig into their code to see what magic they used. ;)