Mirrored from http://tcpm.mrlazyinc.com/files/users/KittenIgnition/ql_repack_guide.html

I feel like I'm going to lose interest in this whole map conversion thing soon, so if anyone wants to know how to do it, I'll write the whole process down here.

Anyone with an inkling of experience with python, C, C++, or any other coding language will probably figure out a way to automate this in no time at all. I don't have that kind of experience, however, so I do this all myself, and it takes a lot of time.

You'll need:

  1. A hex editor (I use XV132.
  2. GTK Radiant (I use version 1.5, which can easily be found by a quick Google search).
  3. Q3MAP2 (an older version is shipped with Radiant, but it's best to use the latest version, found HERE).
  4. quakelivedec. There is a batch script about halfway down that page, so use that for multiple pk3s.
  5. Any program capable of creating zip archives (winRAR is probably best, though).

That's pretty much it, aside from Quake 3 and Quake Live, obviously.

A VERY IMPORTANT NOTE:
Make sure you use ONLY the current Quake Live paks. Anything older will break the shaders and you'll be missing a whole lot of them. It can get pretty ugly. Realizing this made everything so much easier. You can get a list of paks HERE. This list actually has ALL the paks, including some from beta, and some that ARE NOT up to date (example: pak08.pk3 was deleted and no longer used). This is an Orbit Downloader file, and it's plain-text, so you can open it with notepad to look at the list, or import it into Orbit and download everything a lot easier. Keep in mind that some don't exist, and have never existed (example: pak25.pk3 <-- This will be wrong eventually, but I doubt I'll edit it), and Orbit will hang up for a while on these files. If after a few seconds the download doesn't start, just delete the file from Orbit and continue. It's a good downloader, and really helpful for repacking this stuff.

Step 1: Get the bsp. It's important to know that a pk3 is just a renamed zip archive, but QL encrypts their pk3s, so you need quakelivedec to decrypt them, unless you want to waste time trying to do it yourself, you hacker you. Copy whatever pk3 you want to decrypt from your QL baseq3 folder (C:\Documents and Settings\John-Luck\Application Data\id Software\quakelive\baseq3 for Windows XP), and put it in C:\QuakeLive\PAKs. Run the .bat and you should get a zip archive in your ZIPs folder. Extract that and copy the bsp to your Quake 3 baseq3 (wherever you installed that).

On an unrelated note, I highly recommend decrypting, unpacking and repacking all of your Quake Live pk3s if you use wolfcam, because it makes it a lot easier to handle, and it makes loading times substantially shorter. Just copy your whole QL baseq3 into the PAKs folder, run the bat, extract everything (overwriting files is good; they're all the same, but because QL uses separate pk3s, there are a lot of duplicate files taking up space and increasing load times), and zip it all up again. I put each folder in its own pk3 (wc.maps.pk3, etc.), then put all of them inside my wolfcam baseq3. It makes getting files really easy, and it's nice and clean and organized.

Once you have your bsp in your Q3 baseq3, it's time to move on to step 2.

Step 2: convert the bsp to Q3 format. Quake Live has added a new entity: advertisements. They're by far the most annoying part of this whole process, but they aren't that big a deal. The reason I'm saying this is because, along with the addition of this new entity, id has upped the bsp version by one (46 to 47). This is easy to bypass: open the bsp with your hex editor, look 5 characters from the very beginning of the file, and you'll see the hex code "2F", or the character ".", this needs to be changed to "2E", or "/". So select this character, go to edit -> overwrite string... select "hex string" and type "2E" in the box, and hit OK. Your bsp will now run in Q3, but is missing a lot of important functionality, such as textures and advertisements.

A working bsp brings us to step 3.

Step 3: Find all the necessary textures. I do this as the third step, but it can probably be done as step 4 without any problems. How you do this is you open Q3, clear the console, and /devmap <mapname>. If there are missing textures, you'll see their names in the console. Type /condump <whatever>.txt, and close Q3. There will be a text document with all the contents of your console in whatever mod folder you were using. Open it and delete everything except the missing texture lines (trying textures/sfx/white_fog.TGA...). You'll need to have pretty much all of your QL files unpacked for this step, which is yet another reason to repack everything (I have a folder in my C: drive that has all the contents of QL/Q3, unpacked, in their own folders, which is incredibly useful for things like this). For whatever missing image you see, you should look in the corresponding shader file (for textures/sfx/white_fog.TGA, I would look in scripts/sfx.shader) for any shaders accompanying the texture, then go to the texture folder and look for whatever textures the shader uses. Very often, the shader will use more than one image. If you find a shader, copy and paste it in another shader file for the map you're repacking, and name it whatever you want (it would be best, for obvious reasons, to use the name of the map you're repacking). If you don't find a shader, and you're not me, then it doesn't have a shader. Do this for every missing texture in the text file, then add everything to a pk3 and launch the map again.

This is the proper folder setup for a pk3:

levelshots/<mapname.jpg/tga>
maps/<mapname.bsp>
music/<music.wav>*
sounds/<sound.wav>*
textures/<folders_etc/image.jpg/tga>
scripts/<mapname.shader>

*These don't always exist, so if there is no missing sound file, don't worry about it

Once you have everything where it should be, add it all to a zip archive and change the file extension from zip to pk3, then put it on your baseq3 folder. Launch the game to see if there are any more missing textures.

If there are no more missing textures, good. You can move on to step 4. If there are, then do another condump and find the rest of the textures.

Step 4: Fix the advertisement entities. This is a little more advanced, so if you don't want to do this, then that doesn't matter, but it's not like converting a map from QL to Q3 is supposed to be simple; I'm trying to write this guide so anyone can do this, so long as they know how a keyboard and mouse works.

Use Q3MAP2 to decompile the bsp (-convert -format map), and open the map in Radiant. If you're using 1.5, then open the entity list by pressing "L", and expand the worldspawn entity. Select all the brushes listed, and delete them with backspace. You should have only entities left on the map if you did this right. Save the map and close radiant, unless you want to delete any entities, such as the Team Arena entities (chaingun, nailgun, doubler, etc.), or overpower one section of a map by switching a shotgun with a BFG, or deleting spawn points or whatever. I don't recommend doing this, though; keep the map as pure as you can.

Open up the map with a text editor, search/replace every instance of "advertisement" with "func_static", then rename the map so that it matches the bsp (Q3MAP2 renames the map to <mapname>_converted.map) and move them to another, cleaner, safer folder, unless you want to use your baseq3/maps folder for everything.

Make a new text document, and add something like this to it:

q3map2.exe -onlyents <asylum> pause

The pause is to see the status of the compile as quickly as possible. If you get any error at all, you did something wrong. Usually it's just a filename error, so make sure that you have a bsp and map with the same name in the same folder as the bat. If there is no error, then it worked, unless something was done wrong during another step.

The last step is pretty much to replace the old bsp with the new one, and test it again for errors. It helps a lot to change winRAR's settings so that it treats pk3s the same way it does zips, but I won't get into that: you'll have to look around in the settings yourself. Open the pk3, or extract it, and replace the old bsp with the new one, then put the pk3 back in your baseq3 (if you moved it), and run the game. If you can get onto the map, that's good. Look around for the advertisements and make sure they're also visible, and then test all the triggers/entities on the map (it's possible for a trigger to get linked to the wrong target, which is obviously not what you want).

If there were no errors, then the whole thing was a success, and you should be proud of yourself; you converted a map from Quake Live to Quake 3! Now go do this another 95 times and get a complete collection!

If you're doing more than one map, it's best to keep them each in their own pk3s, and duplicate any shaders that appear on more than one map, unless this is for strictly personal use; then I don't care.

During my original attempts at this, I tried a couple different approaches towards fixing the ads. I tried hex editing the classname and text editing the classname; none of them worked. The only way that I know of to do this properly is to recompile the map with -onlyents. Make sure that you DO NOT change the advertisements to func_static in Radiant, otherwise it will screw with the entity list and break the map. Rename them with a text editor, outside of Radiant, to properly switch the entities. I haven't tried this with other entities, but the same rules should apply when changing any entity at all.

oranje is a faggit

4 steps... it seems like so much more work than just "four steps", but I guess that's because I had to figure out how all of this worked, and I haven't had a chance to follow my finalized steps from start to finish on a fresh map: I kept having to change things and fix things and break things and unbreak things.

TheMuffinMan and Shio were the most helpful, along with misc. sources from Google and whatnot. Don't hate, bro!