You can just always give it a default value in the Server_AdvanceTurn.
Normally you would do that with:
local mySetting = Mod.Settings.MySetting or myDefaultValuebut that doesnt work with booleans.
For a boolean value, you can just let LUA falsify the nil for you:
if (nil) then
-- this doenst run
else
-- but this does
end
if (false) then
-- this doenst run
else
-- but this does
end
if (true) then
-- this runs this time
else
-- and this doesnt run
end
Or if you need to do some more advance logic with it that requires you to have a true/false variable, you can use:
local mySetting = Mod.Settings.MySetting
if (mySetting == nil) then
mySetting = true -- or whatever default you want
end
Edited 9/17/2024 09:00:37