2018-05-23 20:35:19 (edited by kingzombie 2018-05-23 20:36:01)

How can this be done? I've seen some games have directories in their packs like /sounds or /steps. etc etc.

2018-05-24 00:30:56

The pack names are just strings. You more or less simulate directories by using that naming scheme.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2018-05-24 19:15:45

Hi,
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.

2018-05-24 21:26:55

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 yikes) to fill in the gaps.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.