How can this be done? I've seen some games have directories in their packs like /sounds or /steps. etc etc.
#1 (edited by kingzombie 2018-05-23 20:36:01)
What post 2 said. This way you can pretty much change a game that used no pack system previously to use one if you just add the files to the pack keeping the rellative path, such as "sounds/steps/concrete/land.ogg". As for extracting those packs into a directory structure, I don't have a tool to do this and I don't think you can just open the files, because you have to create the directory structure first, I dont' fhink file.open will create a directory, only a file if opening a nonexistent file in write mode. I might develop something to do this someday, there are probably already tools to do it, you just have to find them. Either way though, making them is pretty easy.
You could just look for the last / or \, and use everything before that as the path to the directory. At that point, you can use directory_exists and directories_create (I don't remember that function's name, actually ) to fill in the gaps.