Needing a "Dofile"-like operation for a Folder/directory
While working on my latest mod, Morestuff2, I have run into an issue. The mod is broken up into independent "segments", which are separately loaded from a folder. But, with the addition of dozens of chunks of code, there comes a time when the code seems to be too long to quickly access and edit. So, I want to make different scripts for each "part" of a segment, i.e. Crafting or Tools Registry, and load them all, without having to write every path for every script in init.lua, by simply giving the path for the folder that contains all of the scripts. Similar to how the "textures" folder works, where all textures are loaded, but only the folder's path is needed, and any number of textures can be in the folder, but all will be loaded.
However, the "dofile" device only works for single files/scripts, not for entire folders/directories of files/scripts. Using "dofile" and defining a folder's path throws an error, and minetest will not load with such error.
Is there a way to load an entire directory/folder by only defining one path? if so, can you please describe how this would be achieved?
Thank you for your help.
However, the "dofile" device only works for single files/scripts, not for entire folders/directories of files/scripts. Using "dofile" and defining a folder's path throws an error, and minetest will not load with such error.
Is there a way to load an entire directory/folder by only defining one path? if so, can you please describe how this would be achieved?
Thank you for your help.