is there a function that returns a table of all custom resource locations?
i’m storing map files in a folder that is then bundled as a custom resource, then those resources are loaded at program startup.
i can’t use an os function to get the files in the folder, as the folder will not be present on release versions (though i could change to using this method instead if need be)
No there is no function. The simplest solution is to generate a file index file (.lua or .json) when you build and load that file to get a file list.
well ok
i’ll probably go with a simple approach of distributing the map files with the build (would also allow easier creation of custom maps, too)
but for future reference, how would you generate the index file? would it be setup to generate when building, or have to be a manually executed script?
There’s build hooks in the editor scripts that you could use; Editor scripts
Generating a json / lua / text file for your files should be fairly easy!
This would be a good community project for someone to create and contribute!
A known file manifest of what’s bundled into the game’s resource package is useful for games with more dynamic designs.