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

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

Thumbs up

2

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

Some of my games
Keep up to date by following @Jeqofire on twitter!
Ear Ninja?

Thumbs up

3

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.

Sincerely,
Lucas.

Thumbs up

4

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.

Some of my games
Keep up to date by following @Jeqofire on twitter!
Ear Ninja?

Thumbs up