Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / .pak files

Author
Message
Chief Engineer
21
Years of Service
User Offline
Joined: 26th Feb 2003
Location: United States
Posted: 15th Mar 2003 20:23
i was looking over the commands for packing a file, and i was wondering: Elite Force and Quake use .pak files for their games and i was wondering if it is possible to do the same for DB games, using textures, models and sounds in the .pak files. What i mean is, can you make a .pak file for your media in DB, separately store it as a "media.pak" file, then have DB use that file for all of the media that you would use in your games? the example in DB only had it set up for text, just wondering how it could be done with other file formats (if possible). thanx for the help!
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 15th Mar 2003 22:25
You just load a file using the read and write fileblock commands. Format doesnt matter as far as I'm aware, it just copies the file exactly and puts it in a .pak file.

e.g
open to write 1, "media.pak"
write fileblock 1, "media.bmp"

Whatever I did I didn't do it!
kfoong
21
Years of Service
User Offline
Joined: 28th Jan 2003
Location: Australia
Posted: 16th Mar 2003 03:25
then how can you use the files in the pak file?

--------
http://www.stellarblue.vze.com/
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 16th Mar 2003 17:54
To then use the files, you use

open to read 1, "media.pak"
read fileblock 1, "media.bmp"

which will create the file media.bmp from the data in the .pak file. However, if you're going to extract files from a fileblock, you have to remember the order that you wrote the in. For example, if you wrote 3 files to a fileblock, "media.bmp" first, then "picture.bmp", then "music.mp3", read fileblock is going to go through it in the same order, so the first time you use read fileblock you'll get "media.bmp"

Whatever I did I didn't do it!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Mar 2003 19:28
Hmm, I think there's a misunderstanding here...

Kentaree is showing you how to create and use your own packed files, not how to use a '.pak' format file.

I don't know specifically about '.pak' files, but I do know that the '.pk3' files used by Quake3 are effectively zip format files, and can be modified by winzip.

Here's a TPC plugin for reading zip files directly within DBPro that you might find useful : http://www.realgametools.net/forums/index.php?board=19;action=display;threadid=12180

This way also doesn't suffer from the disadvantage of only retrieving files in the order they were written.
Chief Engineer
21
Years of Service
User Offline
Joined: 26th Feb 2003
Location: United States
Posted: 16th Mar 2003 20:44
IanM, thanx for the link. what i was really looking for was a way to use DB classic to encrypt my media files since otherwise it would be easy for someone else to use my media if i release a game. i was wondering if someone has done this before. oh, and you're right, i was thinking of pk3 files but i saw .pak in the examples and i just confused myself on the format.

Login to post a reply

Server time is: 2024-11-24 05:23:31
Your offset time is: 2024-11-24 05:23:31