Looking for some help to fix this.

This is the place to request new mods or give ideas about what could be done.
User avatar
SoulForge
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Wed Apr 13, 2016 6:58 pm
Contact:

Looking for some help to fix this.

Post 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.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1210
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Looking for some help to fix this.

Post 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. ;)
Post Reply

Return to “Ideas and Requests For Mods”