I want to read the settings values of other mods (mod A) in my new mod (mod B) settings.lua. In mod B, I want to create options based on a certain value in settings of mod A. Is there a possible way to do this?
In data.lua and control.lua, it is easy. I know the following code will work:
Code: Select all
settings.startup["mod-A-dummy-value-C"].value
Thanks for your attention,
Schall
Sample code to display what I want to access, if it helps explanation:
Mod A
Code: Select all
--in settings.lua:
data:extend({
{
type = "int-setting",
name = "mod-A-dummy-value-C",
setting_type = "startup",
minimum_value = 1,
default_value = 3
}
})
Code: Select all
--in settings.lua:
local valueC = settings.startup["mod-A-dummy-value-C"].value -- Does not work!
for i=1,valueC do
-- Do something fancy about options...
end