I use a function that doubles the ingredients of a recipe:
Code: Select all
--- Rocket Part Cost Tweaks
for _, recipe in pairs({"low-density-structure", "rocket-fuel", "rocket-control-unit", "rocket-part", "satellite"}) do
for _, ingredient in pairs(data.raw.recipe[recipe].ingredients) do
ingredient[2] = ingredient[2] * 2
end
end

This happens when there is another Mod that also touches that recipe.
First off, I'm not exactly sure what that error means.
Second, how do I prevent it.
What's more frustrating, when I was trying to find a fix, I started to get the same error with a process that was working.
I was tweaking the cost of Bob's Science Pack 4:
Code: Select all
if data.raw.recipe["science-pack-4"] ~= nil then
for _, recipe in pairs({"science-pack-4"}) do
for _, ingredient in pairs(data.raw.recipe[recipe].ingredients) do
ingredient[2] = ingredient[2] * 2
end
end
end
I've tried to do a validation check first:
Code: Select all
if data.raw.recipe["blah blah"] then
Thanks,.