I did some scouring of the forum but came up empty and I'm not sure if the behavior I'm seeing in regards to the settingtypes.txt file is expected/known or if its some form of minor issue.
Issue:
Create a new settingtypes.txt file and place 1 bool config setting in there
Code: Select all
# If enabled do the enabled thing
thing_boolen (Do that thing) bool true
my expectation at this point is that once that setting is placed into the settingtypes file that if the mod is enabled for my game that if I retrieved the setting it should be true.
Code: Select all
enabled_thing = tostring(minetest.settings:get_bool("thing_boolen"))
If I check enabled_thing on load for example at this point the result is that enabled_thing == "nil". If I then close my game then go to settings>>advanced settings and just cycle my "Do that thing" setting to disabled then enabled and then reload my game enabled_thing == "true"
Is this expected/known behaviour with the settingtypes.txt file? is it just occurring as I'm implementing my settingtypes file after I've already got the mod running inside a game? Just curious really as it was a fairly frustrating hour while I couldn't work out why my setting wasn't being set or am I way off the mark :)
Thanks for the help or thoughts.