Ah, what I was needing is this error message:
2.705 Error ModManager.cpp:1758: Failed to load mod "FortressRuins": __FortressRuins__/settings.lua:1: attempt to index field 'AbandonedRuins-set' (a nil value)
stack traceback:
__FortressRuins__/settings.lua:1: in main chunk
Then when I check the file settings.lua
:
You have to change AbandonedRuins-set
to current-ruin-set
. And it looks a bit weird that your mod does this in settings.lua
. What I better can do is that I provide a remote-call function so you don't have to worry about the correct configuration key.
I just added this remote-call function in version 1.3.2:
-- Registers ruin-set name as choosable option and optionally set it as default
---@param name string
---@param is_default boolean
register_ruin_set = function(name, is_default = false)
So all what you have to do is this:
remote.call("AbandonedRuins", "register_ruin_set", "FortressRuins", true)
You probably want to execute this from your control.lua
file and not settigns.lua
. For example make a local function which you register on two events:
local function make_ruin_set()
remote.call("AbandonedRuins", "register_ruin_set", "FortressRuins", true)
-- DO MORE STUFF HERE
end
script.on_init(make_ruin_set)
script.on_configuration_changed(make_ruin_set)