Custom Textures Tutorial - XWE

From SRB2 Wiki
Jump to: navigation, search
Warning icon.png
This article or section should contain one or more images. Please spruce up the article by adding an image.
"Custom Textures Tutorial" redirects here. For the custom textures tutorial for SLumpEd, see Custom Textures Tutorial - SLumpEd.

This tutorial will help you through putting different textures in SRB2 using XWE.

Contents

How Textures work

First, there are graphic images in the WAD as separate entries. There are limits to how large the texture can be depending on what you want to put in WAD. Each section will explain what size you need for the texture you want to put in the WAD. Don't name a custom texture the same as a texture in srb2.srb, and also don't name a flat texture the same as your wall texture.

Next, there are two data lumps: TEXTURE1/TEXTURE2 and PNAMES.

TEXTURE1/TEXTURE2

This data lump contains a list of all the wall and sky textures. The name of a texture can be different from the graphic image entry. You can have multiple graphic images in one texture. This is how really big textures can be made.

Note: It is recommended that you use TEXTURE2 for add-on wads, as this will not require you to copy the entire contents of srb2.srb's TEXTURE1.

PNAMES

This data lump contains a list of all of the graphic images that are to be used in all textures. XWE needs to have the correct PNAMES lump loaded into the WAD, otherwise it will be corrupt.

Note: Don't modify the list unless you made two of the same entry.

Setting up the 2.0 palette

NoteIcon.png Note
This is required to set up, otherwise your texture will end up with the palette colors scrambled

There are several ways to set up the 2.0 palette. Look at this article for details. Setting up the Palette with XWE

Wall Textures

Each wall texture in SRB2 is made up of patches. We first need the image to be the right height and width. Every one of your patches must have a width that is a power of 2 (like 32, 64, 128, and so on). The height of your patch must be 255 pixels or less, but it can be anything else.

Now we need the valid PNAMES which can be found here (Right click and Save As). Insert the valid PNAMES lump in your WAD by using Entry → Load and insert the PNAMES lump. Now we have to add a blank TEXTURE1 lump then rename it later to TEXTURE2: Do Entry → New, then set the name to be TEXTURE1. If it says the lump type is TEXTURE, you've done it right. If it doesn't, delete the lump and try again.

Now we need to put it in the wad, but before we do that, we need to add the marker that will tell that it is a texture. Open XWE and click Entry → New which is in the menu bar. Type in P_START and hit Enter. You should now see a lump with the filetype "MARKER". If its not a "MARKER" type, then delete the lump and try again. This starts off the patch section.

Now click in the menu bar Entry → Load. Find the image you want to use as texture file and select it. Rename the lump name if necessary to use eight characters or fewer. You should now see your texture in the list to the right.

Once you have all the textures added, click Entry → New, and type in P_END. This closes off the patch section.

For all the textures that don't need to be split up and brought together, right-click the texture and select "Add to Patch Names" and "Add to Texture", in that order. When you are done rename your TEXTURE1 to TEXTURE2. If you want to add more at another time, you can just rename back so you can add more textures.

The picture above shows how the List of Entries should look after finishing the work. The textures MYTEXTU1, 2 and 3 and the flats MYFLAT1 and 2 are just hypothetical examples.

Larger Textures

For textures that are larger then 255 pixels, you are going to need multiple patches. In our tutorial, you will learn how to use patches that are already in SRB2. First, we should explain what the TEXTURE2 menu means. To the left of the top bar is the list of all the textures. It also has the width and height and other texture properties. You don't need to worry about the x Scale or the y Scale, that doesn't work in SRB2. To the right of it, you see a bunch of stuff like PID and UID and whatnot. Those deal with the patches in the texture, which are parts of the texture. The PID doesn't need to be changed. The UID is a number that identifies which patch you want to use for the texture. It corresponds to the PNAMES list.

Now on to making textures that need to be split up. Hit Insert on the keyboard or click Textures→New. Make that texture name MARIOVIN with dimensions of 128×128. Now click on Textures→New Patch and fill in the PID to 106. Now you will see the texture in the lower middle with the MARIOW1 texture. After you finished that, add another patch to the MARIOVIN texture and make the PID 310 (which is VINE2). You will now see the upper-left corner of the block to have vines on top of it. Now add three more patches with PID 310 (which is VINE2), but this time we will change the positions. The second VINE2 patch will have the position (64,0) which means the xPos is 64 and the yPos is 0. The other two will have the positions (0,64) and (64,64) respectively. Now the entire texture is covered with vines.

If you need to make your own large texture, then you will need to split your image into multiple parts. Each part must have a width equaling a power of 2, with a height of 255 pixels or less. If you are making a 256×256 texture, just use multiple patches to fill up the black.

Skies

Make a SKYx texture, with x being the integer number you want. A sky texture is like making a wall texture. Once you're done, you can use it in your level headers, using SkyNum.

Flats

We first need the image to be the right height and width. Its height and width must be a multiple of 64 by 64, such as 64 by 64, 128 by 128, 256 by 256, or even 1024 by 1024. Note that as of 2.0, transparency will not work on flats larger than 256 by 256.

Add F_START marker. Click Entry → Load and pick the image you want to use as a flat. Then you need to click the image and then click Image → Save as Doom Flat. Once you add all the flats you want add a F_END at the end of the flats. You can now use the flats in the game.

Note: Flats that have a height and width of 256 will look like they are corrupt when you reload the wad, but they are not. You will still be able to use them in SRB2.

Animated Textures

You're going to need this pack.

This contains the command-line program that generates the ANIMATED lump required to have animated textures and flats. It also contains a .DAT file that tells it how to generate the file. If it generates a SWITCHES lump, delete it. SRB2 does not use the SWITCHES lump.

So how do you tell it to animate textures and flats? Make a copy of the existing DAT file, so you don't mess up the original. Now use Notepad or a similar text editor to open the original DAT. Under the appropriate header (depending on if this is a flat or a texture), slap in a new line, and follow the syntax provided by the column names. This is self-explanatory, but just in case, the speed tells the game how many tics to wait before changing frames, the last name tells it which texture is first in the loop, and the first tells it which texture is last in the loop.

That should be all you have to do, just run SWANTBLS.exe [insert dat name here].DAT and it'll generate ANIMATED.lmp and SWITCHES.lmp. Since SRB2 isn't Doom, SWITCHES is irrelevant, so just put ANIMATED.lmp into your WAD with XWE and you're all set. (For the record, though, SWITCHES was what determined what a texture's "on" and "off" states were in the original Doom. You know how the switches worked; this helped make that effect with new textures.)

See Also

Personal tools
Namespaces

Variants
Actions
Navigation
SRB2
Modification
Community
Toolbox