Hello big forker boss. Your mod works wonders by itself, and with science pack bonanza, but, if I shove them both in the All the Overhauls modpack, suddenly the game doesn't finish loading and it says this:
"Failed to load mods: prototypes/technology/recipe-preprocess.lua:12: attempt to compare two nil values"
So, since I know next to nothing about coding, I did the next best thing, and I asked an ai, Claude, and I got this answer:
"Here's what's happening:
- tech_order_reverse is initialized in preprocess-replacement.lua and preprocess.lua.
- unlocking_tech is being populated in the same file (recipe-preprocess.lua) where the error occurs.
The issue likely stems from one of these scenarios:
- effect.recipe is not a valid key in unlocking_tech
- key is nil
- Either unlocking_tech[effect.recipe] or key is not present in tech_order_reverse
To fix this, you should add some nil checks and error handling. Here's a suggested modification:
if unlocking_tech[effect.recipe] then
local tech1 = tech_order_reverse[unlocking_tech[effect.recipe]]
local tech2 = tech_order_reverse[key]
if tech1 and tech2 then
if tech1 > tech2 then
unlocking_tech[effect.recipe] = key
end
else
log("Warning: Missing tech order for " .. tostring(unlocking_tech[effect.recipe]) .. " or " .. tostring(key))
end
else
unlocking_tech[effect.recipe] = key
end
This modification:
- Checks if unlocking_tech[effect.recipe] exists before trying to use it.
- Retrieves the values from tech_order_reverse separately.
- Checks if both values exist before comparing them.
- Logs a warning if either technology is missing from tech_order_reverse.
- Sets unlocking_tech[effect.recipe] to key if it didn't exist before.
Additionally, you might want to add some debug logging to understand why these values might be nil:
log("Debug: effect.recipe = " .. tostring(effect.recipe))
log("Debug: unlocking_tech[effect.recipe] = " .. tostring(unlocking_tech[effect.recipe]))
log("Debug: key = " .. tostring(key))
Place these log statements before the comparison to get more information about the values when the error occurs.
If the issue persists, you may need to investigate why tech_order_reverse doesn't contain all the expected keys. Check the code in preprocess-replacement.lua and preprocess.lua where tech_order_reverse is populated to ensure all technologies are being added correctly."
Anyways, GL HF figuring this issue.