The wiki has moved over to GitHub: https://github.com/sirjuddington/SLADE/wiki
In this tutorial, the object is to import textures from a texture pack into a .WAD file containing a map.
First, we need a work-in-progress map. We were working on an awesome level, but felt like it needed new textures to express its full potential, and here we will show how to merge a texture pack into the map file so as to have these new resources at our disposal once we go back in map editing mode.
Pictured: an awesome map.
Pre-formated texture pack
We have our map, now to add a texture pack. In this tutorial, we'll get Nick Baker's 5th episode set. It's already in the Doom format so it's simpler. Download it and open it with Slade.
It's a wad within a zip. Not a problem, Slade can open zips and wads just as easily. In fact, you can even open the wad from within the zip; just double-click on it.
And now you can see the content of the texture pack. Notice how the tab name tells you this archive is opened from within another archive. Now, to copy that inside the map. Just select everything. Click on the first entry, hit Ctrl+Shift+PageEnd, and you've now selected all the entries from the archive all of them in one fell swoop. It's not magic, it's very standard user interface conventions.
Now that everything is selected, right click on the mass to make the context menu appear.
Click on "copy", then go back to the tab corresponding to your map mod. You should never disturb the order of map lumps or it could break the map. So, select the last map lump; here the BLOCKMAP lump. (Depending on the map format, the last map lump may be something else. It'll be BEHAVIOR or SCRIPTS in a Hexen-format map, ENDMAP in UDMF, and MACROS in a Doom 64 map.)
Right-click to make the context menu appear, click on "paste", and all the copied entries from the texture pack are now inserted after the BLOCKMAP lump.
Notice how the copied lumps appear in green: this means that these are new lumps, not saved yet. Slade color-code entries this way so you can easily tell which entries are new (green), which are modified (blue), which are read-only (red) and which are safely saved to disk (black). What these green lumps tell us is therefore that we need to save our work. Click on the "blue disk" icon to save the modified current entry. You may have guessed that the disk icon follow the same convention: the blue disk is to save the current modified archive, the green disk is to save it as a new archive. The stack of blue disks is to save all currently opened archives. Here we do not need it.
We have saved the file. Notice how all entries are no longer green but black, showing that they are in the same state in memory as they are in the file.
You can now browse through the graphics and perhaps modify them further.
Turning images into textures
Now this was easy because the 5th episode set is already set up as Doom expects flats and textures to be set. What to do if instead the texture pack is just a collection of images? We'll see with a second example, using this time the Adrenix Texture Pack, which are textures taken from Adrenix. Here, the textures are presented in a format compatible with some source ports, notably ZDoom, but not all, so we will see how to convert it to the Doom format.
First, download and open the pack.
Now, let's set up a bit to prepare for adding flats and textures. Create the following entries as marker lumps, in order: FF_START, F_END, PP_START, PP_END. (Note how there's only one F in F_END, even though there are two in FF_START. This is one of the many little quirks that await the Doom modder.)
And name the entries FF_START, F_END, PP_START and PP_END in sequence. New entries are inserted right after the currently selected entry, so move the selection down as you create them.
Once you're finished, it should look like this:
ZDoom lets you use any type of texture on any type of surface, but "vanilla" Doom makes a distinction between "flat" textures (for use on floors and ceilings) and wall textures. In the Doom modding jargon, a flat is a floor or ceiling texture, and the word "texture" is used exclusively for wall textures. Adding flats is simple, so we'll start with this.
Flats have two restrictions: first, they need to be 64x64 pixels in dimension, and secondly, they need to be entirely opaque. Since there wouldn't be anything above or below, flats cannot have transparency. Here I took some of the first textures from Adrenix that met the criteria, and that looked like they'd make more sense on a ceiling than on a wall. Flats have to be placed between the FF_START and F_END markers.
As you can see, they are PNG graphics, and Doom cannot work with them (contrarily to source ports such as ZDoom). So we have to convert them. Since we want flats, we will convert them to "Raw Format (Flat, Colormap, etc.)".
Look at the two preview graphics. One show you the image as it currently is, the other show you as it will be once converted. You can see the colors are slightly off in the converted preview. Why is that? The reason is that PNG images contain their own palette, while the formats native to Doom depend on an external palette. On our example, we have loaded doom2.wad as the base resource, so the global palette is set to Doom II's PLAYPAL. Under each preview image, you have a palette selector, which allow you to choose the palette used for input and for output. Since PNG have their own palette, the input selector will not have any effect here; however you can see how the output image changes if you use a different palette. If, at this point, you only see a gray image for the output, it's because you have not set a base resource archive. You should do so, it will be important later. But for the moment, you can select the Doom palette and continue on with the conversion.
Luckily, the Adrenix palette seems relatively close to the Doom palette in its color ranges, so the images here do not suffer too much from the conversion. The only way to avoid color degradation would be not to convert at all, but that restricts the mod to be only used with source ports that support PNG graphics.
Anyway, click on "Convert All" and everything proceeds just as planned.
Textures are slightly more complicated. Doom creates "composite" textures from "patches" by assembling together different graphics. Let's say you have a large wall texture and a small switch texture. You can compose them together so that now you have a large wall texture, a small switch texture, and a large wall texture with switch, but the "new" texture hardly takes any disk space at all since it doesn't use its "own" graphic data. Doom creates a list of patches in the PNAMES lump where it gives an index number to each patch. Then in the TEXTURE1 and TEXTURE2 lumps, it refers to these patches by their index number instead of their name. As a result, careless modification of the PNAMES lump can entirely destroy most of the textures in the game, since they will reference the wrong patches. Slade only adds new patches to the end of PNAMES, avoiding the problem.
Here, however, the graphics are stand-alone, so all the textures we'll make will be composed of a single patch, making this system an extra complication to deal with. Fortunately, Slade automatizes all this so it's still very simple.
First, select the textures and copy them in between the PP_START and PP_END markers. Convert them to the "Doom Graphic Format" - it's the default choice and it's what Doom uses for patches, sprites, HUD elements, menu and interface graphics, and pretty much everything that is an image but not a flat.
You can see that depending on the colors used in the source picture, the image degradation can be quite severe. This is the perils of having to convert to the Doom palette.
Now that the images are all converted, we need to add them as textures. Select them all, then right-click and in the context menu, choose "Gfx->Add to TEXTUREx". This will automatically add them to the patch table, too. (Whereas if you choose "Add to Patch Table", it will not automatically add them to the texture list.)
Now is the interesting part. If you do not already have a PNAMES/TEXTURE1 system set up in your archive, you will see this messagebox appear. Of course, you should select "Yes".
And here is why it is important to set a base resource archive. In vanilla Doom, the PNAMES/TEXTURE1 lumps are not cumulative, which means that only the last one loaded is read. As a result, if you create a new TEXTURE1 lump, it will need to contain a copy of all the texture definitions from the base resource archive otherwise you will not be able to use the stock Doom textures at all! (Again, some source ports such as ZDoom allow for cumulative loading of texture lumps, but if you were making this for ZDoom you wouldn't have had to convert everything; you could have just copy-pasted everything like in the 5th episode example above and it would have been done.)
So if you have not set a base resource archive yet, click on "Cancel" and set it up now, then start again. Be sure to select "Import from Base Resource Archive" then click "OK". Note how the texture format options become grayed out when choosing to import from the base resource; this happens because the format will be dictated by the format of the base resource.
Scroll down a little, you will see that newly-created PNAMES and TEXTURE1 lumps have appeared below the PP_END marker. You can save your work, that's all that's needed!