ZIP file support in torque?
by Dave Calabrese · in Torque Game Engine · 05/02/2005 (7:47 pm) · 12 replies
I know this support is in Torque, I'm just not having much luck finding documentation or examples of how it works. Looked through the documentation, and I probably just missed the page talking about it. =)
Could anyone out there give me some details on how this works? I want to use .zip files like the .pk3's in Quake 3 (compress packages that the game can read). Do I just read the contents like a directory, do I need to load it up or anything... what's the deal with these?
Thanks in advance!
-Dave C.
Could anyone out there give me some details on how this works? I want to use .zip files like the .pk3's in Quake 3 (compress packages that the game can read). Do I just read the contents like a directory, do I need to load it up or anything... what's the deal with these?
Thanks in advance!
-Dave C.
About the author
Recent Threads
#2
05/02/2005 (11:03 pm)
Nice writeup, Paul.
#3
11/12/2005 (4:32 pm)
I'm book marking this. Very useful!!
#4
Anyway, Paul, thanks for posting this. And Tatjana , thank you for bumping this thread up.
11/12/2005 (5:53 pm)
Wow. This is kind of old, but really nice. I can't believe I missed seeing it.Anyway, Paul, thanks for posting this. And Tatjana , thank you for bumping this thread up.
#5
11/12/2005 (9:17 pm)
Don't forget, there's resources to encrypt zip files too!
#7
11/13/2005 (2:49 am)
Very useful information.
#8
11/13/2005 (4:29 am)
It's not crossplatform, AFAIK. But other than that, cool resource.
#9
11/16/2005 (10:38 am)
Thank you much. One of the Old questions buzzing around in my head for later! Thankz
#10
If i Zip the missions file foleer up and rename the actual real file folder i zipped and or delete it the game will still fire up and run out of the zip file , VERY VERY cool
How ever it seems to unzip the files and makes a new mission file folder with the files that were in the zip file, Which means people could still access the files and mod them even with a password on the zip file could they not ?
Defeintly great for when a person is compiling an installer for the game though.
Is there an actual way to create a libary where no one will have access to your files ?
11/20/2005 (6:34 pm)
This works well in a way but i may be misunderstading a part of it. If i Zip the missions file foleer up and rename the actual real file folder i zipped and or delete it the game will still fire up and run out of the zip file , VERY VERY cool
How ever it seems to unzip the files and makes a new mission file folder with the files that were in the zip file, Which means people could still access the files and mod them even with a password on the zip file could they not ?
Defeintly great for when a person is compiling an installer for the game though.
Is there an actual way to create a libary where no one will have access to your files ?
#11
11/20/2005 (6:53 pm)
Quote:Is there an actual way to create a libary where no one will have access to your files ?Many people have spent many, many millions of dollars trying to make the answer to this question be, "Yes." Unfortunatly, or maybe fortunatly, the answer will always be, "No."
#12
11/20/2005 (6:57 pm)
Cool Cool So the best one could do then is maybe encypt the zip files, And or rename them as well to something along the lines that tribe did with there zip files from Zip to vl2 files.
Torque Owner Paul Scott
Default Studio Name
The zip file itself is seen as a folder, to the TGE file system.
Any directories inside the zip file itself are seen as subfolders in the zipfile's folder.
The zip file's folder has the same name as the zip file, minus the ".zip".
To easily see this in action, whip up a zip of starter.fps/data/missions/*, and put it in starter.fps/data/ . You'll see 2 of every mission you had before. If you load the right one, you'll see the path to the mission file TGE saw, in the console log.
If you want to change the ".zip" extension, you'll need to dig into the resource manager. That suffix is hardcoded in the engine.
See resManager.cc:334 and resManager.cc:350 for the places where ".zip" is hardcoded.
If you want to change "zip" to something else, it must also be 3 characters long. That's hardcoded too, in other parts of the engine ( resManager.cc appears to not care, but other parts of the engine do ).