Get an error with attempting to read a setting
Posted: Mon Aug 29, 2022 10:30 pm
I have been trying to make a mod to either move all effects from the logistic system tech to logistic robotics, or simply remove utility science pack as both a prerequisite and needed pack, and change the count from 500 to 150, with these modes interchangeable via settings. I get an error I had gotten before with mismatched parenthesis, but there is none, and it claims that the "earlierlogisticsmainsetting" on line 13 is the error, even though the same line is in line 2, except with "merge" instead of "changepack". If there is any other errors in the code, it would be nice to mention them, as it seems no matter what I fix, there is always a problem. Please note I am not good at modding, and the error is probably obvious.
Edit: I have also browsed the forums for solutions, but none of them worked.
Code: Select all
script.on_init(function()
if settings.global["earlierlogisticsmainsetting"].value == "merge" then
table.insert(data.raw["technology"]["logistic-robotics"].effects, {type = "unlock-recipe",recipe = "logistic-chest-active-provider"})
table.insert(data.raw["technology"]["logistic-robotics"].effects, {type = "unlock-recipe",recipe = "logistic-chest-buffer"})
table.insert(data.raw["technology"]["logistic-robotics"].effects, {type = "unlock-recipe",recipe = "logistic-chest-requester"})
if data.raw.technology["logistic-system"] then
data.raw.technology["logistic-system"] = null
end
end
end)
script.on_init(function()
if settings.global["earlierlogisticsmainsetting"].value == "changepack" then
if data.raw.technology["logistic-system"] then
data.raw.technology["logistic-system"].prerequisites =
{
"logistic-robotics",
"chemical-science-pack",
}
data.raw.technology["logistic-system"].unit.count = 150
data.raw.technology["logistic-system"].unit.ingredients =
{
{"automation-science-pack", 1},
{"logistic-science-pack", 1},
{"chemical-science-pack", 1}
}
end
end
end)