As of now, game.write_file() allows one to write out a specific file to script-output/* where the structure below script-output is free-form and where multiple modules might interfere.
As such, write_file should additionally prefix that output folder by the module name, e.g. script-output/my-mod but leaving out the version number.
In addition, it would be nice to be able to read the contents from a specific directory in that thus sandboxed output directory using the game object, e.g.
Code: Select all
for file in game.read_dir() do
if file.is_dir then
else
-- is file, do something with it
end
end
The user could then place additional resources, e.g. image/png, or x-application/ogg etc. and the module would then be able to use these resources in the game,
provided of course that the resource loading mechanism supports other paths than just mods/my-mod_0.0.1/images/ etc.
How about implementing such a mechanism?
This would allow the user to customize for example a jukebox where every player in a multiplayer session can have his or her own personal background music a/o imagery for ingame banner displays,
e.g. picture slide shows etc.
See also viewtopic.php?f=33&t=6461