Code: Select all
data.raw["technology"]["advanced-electronics"].enabled = "false"
Code: Select all
data.raw["technology"][].enabled = "false"
Code: Select all
data.raw["technology"].enabled = "false"
Code: Select all
data.raw["technology"]["advanced-electronics"].enabled = "false"
Code: Select all
data.raw["technology"][].enabled = "false"
Code: Select all
data.raw["technology"].enabled = "false"
Yes
Code: Select all
for name, prototype in pairs (data.raw["technology"]) do
prototype.enabled = false
end
Code: Select all
for name, prototype in pairs (data.raw["recipe"]) do
prototype.enabled = false
end
Code: Select all
for name, prototype in pairs (data.raw["recipe"]) do
prototype.enabled = false
if prototype["normal"] then
prototype.normal.enabled = false
prototype.expensive.enabled = false
end
end
While I don't think it'll cause you trouble in vanilla, this has two issues. You should check if normal exists and if expensive exists separately, since you can specify one without the other, and it's also possible to set it equal to false to disable it for that difficulty. The first issue is that if normal is defined and expensive isn't, this code would create an error by trying to reference a property of the nil expensive value. The second is that if expensive is defined but normal isn't, your code won't disable the recipe properly.iamdanthemanstan wrote: Wed Aug 11, 2021 9:47 pm Big thanks. For anyone coming to this later here is the code that worked per PFQNiet's suggestion.Code: Select all
for name, prototype in pairs (data.raw["recipe"]) do prototype.enabled = false if prototype["normal"] then prototype.normal.enabled = false prototype.expensive.enabled = false end end
Code: Select all
for name, prototype in pairs (data.raw["recipe"]) do
prototype.enabled = false
if prototype["normal"] then
prototype.normal.enabled = false
end
if prototype["expensive"] then
prototype.expensive.enabled = false
end
end