Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Make technic use minetest.conf style settings? #659

Open
DustyBagel opened this issue Dec 16, 2024 · 1 comment
Open

[Discussion] Make technic use minetest.conf style settings? #659

DustyBagel opened this issue Dec 16, 2024 · 1 comment
Labels

Comments

@DustyBagel
Copy link
Contributor

DustyBagel commented Dec 16, 2024

Technic has it's own settings system instead of using minetest's own setting system. This can be less than ideal for a few reasons:

  • When you update technic, all the settings are reset instead of being stored in the minetest.conf file.
  • Settings can't be changed in the minetest settings Gui on mobile platforms.

I would really like to move to mintest's settings system. If backwards comparability is desired, we can easily implement it something like this:

if minetest:settings("setting_name") then -- If the setting can't be retrieved or is at its default then this will return nil
    technic_settings_table.setting_name = minetest:settings.get("setting_name")
else
     -- Use default setting.
end

Other mods have had a similar system. I would really like to get started on this when I find the time but first I would like to get the community's thoughts.

@SmallJoker
Copy link
Member

SmallJoker commented Dec 16, 2024

I agree that the minetest.conf system should be used. Here's some settingtypes.txt parser code to retrieve the default values: https://github.com/minetest-mods/areas/blob/master/settings.lua

EDIT: I think the setting priority should be as follows:

  1. value specified in WORLDNAME/technic.conf (world-specific settings)
  2. value specified in minetest.conf (global settings)
  3. default value from settingtypes.txt

This way we can ensure compatibility with older worlds and yet allow server owners to move the settings to a separate file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants