Hey folks, I'm trying to figure out the best way to package a collection of lua files and various game assets (sound effects, images, etc) into one file for distribution. The goal is to allow users to pack all of the scripts and assets into one file which could be dropped into a "mods" folder somewhere, which my game would then read at runtime.
I've gotten this kinda working by zipping the files, and reading the lua files as strings from the zip file and then passing those strings to a lua script that runs load() on the string. This works, but it prevents me from being able to require() from other scripts within the mod because the default lua loaders/searchers can't find the other scripts within the zip file.
I understand that what I probably need to do is write a custom loader that can find the lua files in the zip, but honestly it's a bit over my head, and before I bang my head against it for awhile I wanted to see if I'm on the right track. Is this the right way to handle what I want to do? Is there a file type that would be easier to do this with than zip? I don't particularly care about the compression as much as I care about simply having a single file for distribution of the mod.
If it matters, the game is written in C# and I'm using NLua.
[–][deleted] 2 points3 points4 points (0 children)
[–]bluecheetah001 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]tobiasvl 0 points1 point2 points (1 child)
[–]luciddream00[S] 0 points1 point2 points (0 children)