Making the pk3 file

When you're all done with your map and ready to release, there are a few things you should do before creating a pk3 file and placing your raw map (.bsp) file in it.

If you haven't noticed, in every pk3 there is a basic setup to be followed to make a pk3. It consists of these main folders.


Now, you may not be using all these folders in your maps, I'll explain that in a little bit. Once you have this set of folders set up. You can start copying over your files. Let's start with the easiest.

Note: you should create a new folder and call it your map name and place in your maps folder. So it should look something like this defrag/maps/ghost-pornstar2/maps/*.bsp file

Maps: If you're making a Defrag map the only thing that should go in your map folder is the bsp file


Scripts: All your shader files and readme should be placed in this folder, as well as the defi(see tutorial on creating a defi file.) Note: the readme file could also be placed in the main folder, next to all the other main folders (such as maps, textures, scripts).


Levelshots: Only your levelshot of your map should be placed here. It MUST be called exactly what your map name is called. In this example, the map is called ghost-pornstar2, hence the levelshot should be called ghost-pornstar2. Also the levelshot should only be a jpg file (normal, not progressive).

Env: If ONLY you used a custom skybox this folder should be used, in this case I did use a skybox. The main folder would be called "env" and in the folder needs to be accompanied with another folder (depending on the shader, I will get more into this later on, but most of the time it does have another folder inside the "env" folder.)


If you open this folder you should see six files (either tga or jpg) that make up the skybox. One for each side of the skybox: Front, Back, Up, Down, Left and Right.


So looking back at this folder it should look like env/skybox_name/ textures here

Sound: Just like the Environment (env) folder it would also be placed if you used it in your map. Also would be placed in the pk3 the same way.


When I open sound folder I will have another folder also called by map name (not necessary, but I like to keep organized) with two sound files. Which would look like this baseq3/sound/ghost-pornstar2/sounds here

The next step would be to copy all these files to your map folder and it would look like defrag/maps/ghost-pornstar2/sound/ghost-pornstar2/sounds.wav (Files MUST be in wav format).


If you are unsure which sound you used, you can always go back to radiant and pull up the entity windows (by selecting it and pressing n).


Music: It is to be compiled just like sound, if only you were to use music in your map, either by linking it to a trigger or having it played throughout the map.

Models: Same thing with sound, music and env, only include in your pk3 if you used any models in your maps. The concept is the same as well. You can see in my models folder I have another folder called "mapobjects" and in that folder there are other folders consisting of the models that I've used as well as the textures that might come with it.
Note: some models require a shader as well. This must be included in the scripts folder.


Textures: We save the worst for last. The more textures you use from different sources for the annoying it will become to find them. You want to start by grabbing each texture exactly where you grabbed it from, if you are unsure where u got them from, you can always go back to radiant. Go to the textures tab and hit "Flush and reload shaders".


What this will do is reload only the textures/shaders you have used in your map and show them in the texture window as well as load them into the console on the bottom, if u pull it up you can see the entire list of where the textures you have used came from.


I'll use liquids folder as an example mainly because of the shader. For some reason this shader would come up missing when I did not include it in the pk3 while testing in a clean copy of quake3 (which u should always do so you don't release a map with missing textures.) Most shaders comprise of more than one texture. You need to have all the textures in the proper folder for it to work properly, if you are unsure which textures are being used in a certain shader or in which folder it belongs in, you must pull up the shader and find the name in radiant.

Note: the name in radiant may not always be the same as the actual file.

For example, this liquid is called, "clear_ripple_q3dm1." You will not find this one texture name anywhere in your pk3 files, because it isn't one file; it's a shader made up for three textures given that name for radiant ONLY. If you pull up the shader and search for the name you see in radiant, this is what you will find.

	qer_editorimage textures/liquids/pool3d_3.tga
	qer_trans .5
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm water

	cull disable
	deformVertexes wave 64 sin .5 .5 0 .5	
		map textures/liquids/pool3d_5.tga
		blendFunc GL_dst_color GL_one
		rgbgen identity
		tcmod scale .5 .5
		tcmod transform 1.5 0 1.5 1 1 2
		tcmod scroll -.05 .001
		map textures/liquids/pool3d_6.tga
		blendFunc GL_dst_color GL_one
		rgbgen identity
		tcmod scale .5 .5
		tcmod transform 0 1.5 1 1.5 2 1
		tcmod scroll .025 -.001

		map textures/liquids/pool3d_3.tga
		blendFunc GL_dst_color GL_one
		rgbgen identity
		tcmod scale .25 .5
		tcmod scroll .001 .025

		map $lightmap
		blendFunc GL_dst_color GL_zero
		rgbgen identity		

As you can see this one shader uses three textures: pool3d_3, pool3d_5 and pool3d_6 you must include these textures in the given folder, in this case it is a liquids folder. So your working folder should look like yourmapname/textures/liquids/pool3d_xxxx

Note: make sure you spell your folder names correctly, if its misspelled all textures in that folder will come up as a missing texture in game.

In this same example with the liquids shader, if you ended up not including the shader file for it, but you did include the textures, it will show up as a missing texture in game, what good is a texture if it doesn't have something to tell it what to do?

Once you have finished copying over all your files, the last thing to do is create the actual pk3 file, create a new zip file and rename the extension to pk3 or copy an existing pk3, open it, and delete all its contents, replace it with your files and rename. Note: DO NOT copy your folder name into the pk3, when you open a pk3 the first thing SHOULD NOT be the folder called yourmapname consisting of all the other folder/files... the first thing you should see is what I posted in the start of this tutorial which is... Maps, Levelshots, Textures, Scripts, Env (optional), Models (optional), Sound (optional), Music (optional).

Written by Ghost