This mod makes it really, really easy for other mods to load Lua-based configuration settings. It's as simple as adding "luaconfig" to your mod's depends.txt and putting this at the top of your init.lua:
Code: Select all
local config = luaconfig.loadConfig();
Code: Select all
mymod = { config = config };
This mod allows simple Lua variable-based configuration settings that almost guarantee that you don't accidentally set global variables from the config files (you can if you REALLY try, but it's difficult). You'll have access to all variables defined from the config files using logic like:
Code: Select all
print(config.message);
Require Minetest Version: (probably any; tested in 0.4.12)
Dependencies: (none)
Soft Dependencies: (none)
Craft Recipes: (none)
API:
Code: Select all
luaconfig.loadConfig([modName, [configTable]])
Copyright and Licensing
Author: Prestidigitator
License: WTFPL
Change History
Version 1.0
- Released 2015-05-03
- First working version.