Mod settings not working?
Posted: Mon Feb 19, 2018 1:57 pm
I'm brand new to modding and trying to figure out why someone else's mod isn't working, so sorry if this is a daft question.
There's a setting which is declared in settings.lua like this:
I've changed the setting in the game's UI and now my mod-settings.json contains this:
In control.lua I do this:
And then factorio-current.log has this:
What's going on? Why is the value in mod-settings.json changed but the value seen by the mod not changed?
I'm running Factorio 0.16.24 on Ubuntu 17.10, if that helps.
Thanks for any help,
Tom
There's a setting which is declared in settings.lua like this:
Code: Select all
data:extend{
{
type = "string-setting",
name = "railloader-allowed-items",
default_value = "ore",
allowed_values = { "ore", "ore, plates", "any" },
setting_type = "runtime-global",
},
...
}
Code: Select all
{
"startup": {},
"runtime-global": {
...
"railloader-allowed-items": {
"value": "any"
},
...
},
"runtime-per-user": {}
}
Code: Select all
local allowed_items_setting = settings.global["railloader-allowed-items"].value
log("{allowed_items_setting = "..allowed_items_setting.."}")
Code: Select all
78.402 Script @__railloader__/control.lua:16: {allowed_items_setting = ore}
I'm running Factorio 0.16.24 on Ubuntu 17.10, if that helps.
Thanks for any help,
Tom