[Solved] Settingtypes.txt odd behviour?

Post Reply
User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

[Solved] Settingtypes.txt odd behviour?

by sirrobzeroone » Post

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.
Last edited by sirrobzeroone on Fri Oct 12, 2018 09:15, edited 2 times in total.

User avatar
v-rob
Developer
Posts: 971
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: Settingtypes.txt odd behviour?

by v-rob » Post

I came upon this too. I don't think this is intended, and I can't find a way to fix it. It's very annoying.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Settingtypes.txt odd behviour?

by TumeniNodes » Post

edited to remove, as I misunderstood what you were asking
A Wonderful World

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Settingtypes.txt odd behviour?

by rubenwardy » Post

This is expected behaviour, the file is only used in the advanced settings window and not for default settings. There's an open feature request for this
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

Re: [Solved] Settingtypes.txt odd behviour?

by sirrobzeroone » Post

Thanks all appreciate the info :)

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests