How to extend another mods setting
Posted: Sat Sep 12, 2020 1:01 pm
I'd like to hide another mods setting. I want to access the existing prototype, check for its existence, and set the hidden flag to true.
Variations on the above don't work because I can't find where the setting prototype lives in `data`. The following does work
But in this case I am completely overwriting the setting, and if it is ever removed I am actually adding the setting back in. I am doing this process in settings-updates.lua, and have been following https://wiki.factorio.com/Tutorial:Mod_settings and https://wiki.factorio.com/Tutorial:Modd ... e_creation but its not clear where the settings prototypes live.
How can I access the existing setting prototype and extend it?
Code: Select all
if mods['pycoalprocessing'] then
local oreGen = table.deepcopy(data.raw['settings']['ore-gen'])
oreGen.hidden = true
data:extend{oreGen}
end
Code: Select all
if mods['pycoalprocessing'] then
data:extend({
{
type = "bool-setting",
name = "ore-gen",
setting_type = "startup",
default_value = false,
order = "e",
hidden = true,
},
})
end
How can I access the existing setting prototype and extend it?