Should be v1.09.4-OK
---
Nearly two years ago (as of the latest edit of this post), I decided to register with you guys to see what I could do about getting custom textures to work. The problem was, the tool I was using (XWE) misinterpreted TEXTURE1, causing all sorts of problems.
A small ray of hope was there, though, as a441 had made tools that worked, and worked well, at converting PNAMES and TEXTURE1 to something that was editable in Notepad. After the four months (ie: the past weekend) I finally managed to secure a copy of those tools, for my own perusement and so forth.
Well, first off, yes, it worked:
But there was an interesting side-effect... XWE was reading TEXTURE1 properly! I confirmed this by converting the lumps to text and back and giving them their own wad, and then setting XWE up so my IWAD was SRB2.WAD; all the textures displayed properly, and with some exceptions (mostly skies, though they still work properly).
Well, obviously, I had to prove this was working A-OK, so I whipped up some old textures I'd ripped from SMB2 (the US one), and tried adding them on to TEXTURE1 and PNAMES... and wouldn't you know it, it worked!
---
But I digress. You're probably waiting for the point of this topic, and I'll be blunt: this is a quick tutorial on how to get custom textures working in SRB2 using XWE. No pictures for now, so follow closely.
First off, you'll need these:
The latest version of the eXtendable Wad Editor
A zip with the valid TEXTURE1 and PNAME lumps in it
A texture to work with; width must be a power of 2 (like 32, 64, 128 and so forth), height must be 255 pixels or less (but it can be anything else otherwise; for taller textures, split it up into multiple textures of, say, 128 pixels height), and for ease's sake, put it in DOOM's 256-color pallette! (The .GIF file should have the right pallette, if I'm not mistaken.)
Yeah, that's pretty much all you need.
---
So how do you get started, you ask? This is easy.
First, open XWE. It'll most likely prompt you for your IWAD; attempt to point it at SRB2.SRB. If it complains, point it to your commercial DOOM2.WAD, and if you don't have that, download FreeDOOM. You can edit the INI later on to point to SRB2.SRB, assuming you know what you're doing (remember, kids, BACK UP FIRST!)
Now, make a new WAD - "MOO.WAD" for example - and insert the valid TEXTURE1 and PNAME lumps. Assuming it still works like it did in the past, it should work perfectly - no random textures with "W" at their ends.
Now, go to Entry->New. Type in "P_START" and hit Enter. You should now see a third lump with the filetype "MARKER". If you don't, something screwy is afoot, delete this lump and try making it again.
Now, Entry->Load. Head over to your texture file and select it. Rename the lump name if necessary (eight characters, folks!). You should now see your texture in the list, and on the right, amongst the cyan, your texture should be clear as day. Congrats, the patch is loaded! But don't start using it in your levels yet, it won't work that easy.
If you have more textures to add (or you're making a big texture but lack the other pieces of it), add them now. If not, then Entry->New, and type in "P_END". This closes off the patch section.
So how do you use these? Good question. Really simple answer, too. Right-click the texture and select "Add to Patch Names" and "Add to Texture", in that order. The patch name is now in PNAMES, and if you select TEXTURE1, your patch will now be in a little box shaped its size. For most intents and purposes, NOW your texture is usable in SRB2. Go ahead and create a level in MOO.WAD using it. (Unless you were making BIG textures, in which case, you'll notice there's a problem. Delete all the parts of it besides the top part from TEXTURE1; I'll explain how to fix this in a bit. Read on.)
---
So what does all this jargon on the upper-right that displays when TEXTURE1 is selected mean, anyway? Well, on the left of the top bar is the list of all the textures. If you want to make a new one, just hit Insert (or Textures->New). Make that texture name, oh, say, "MARIOVIN" with dimensions of 128 by 128.
So, this brings us to the right part of the window. The patches. See, the files you loaded weren't the textures themselves; they're known as "patches", only PART of the whole, which are added one-by-one to make the texture. If you're planning on making large textures, as I've been mentioning for a while, this is a key thing to learn, so, here, I want you to do Textures->New Patch. Fill in the PID for this to 74; this corresponds to its position in PNAMES, so if you need future reference for patch IDs, turn to that lump. Anywho, you should now have a Mario block.
...been there, done that. So now, make another patch (still Textures->New Patch), but this time use a PID of 125. Now you have a Mario block, with one corner with vines on it. Simple, neh?
Repeat that last step three more times, but make the coordinates for each VINE2 (64,0), (0,64) and (64,64) respectively - those should be the other boxes, previously both 0. Now all four corners should be covered with vines. Textures->Save (or try leaving, XWE's pretty good at nagging you about saving). Now you have yet another texture to toy around with.
So, as I've said, you can use this to create REALLY BIG textures. Make it as big as needed - probably tall, if you were making a 256x256 texture - and then just use multiple patches to fill up the black, and you should be fine. Hey, if Zim's Base can do it, why not you?
I'll note that this is why I had you split tall textures up - it creates multiple patches with which you can create a single texture. Tall patches corrupt the bottom-most line of the patch, which is not good by any stretch of the imagination. Thus, two 128-tall patches working together to make one 256-tall texture is BETTER than one single 256-tall patch, but anything smaller can be done just as easily with one patch. Follow? I hope, but do feel free to ask.
---
Now, flats. What level is complete without them? Admittedly I've not done much experimenting here, but mostly everything I've tried thus far works, so bear with me.
Add "F_START". Now, select "Floors" at the list of buttons on the bottom. Now, Entry->Load whatever you want to use as a flat. You'll see the image, but you're not done yet! It's usable, but it'll look all corrupted. a441 often suggested doing some weird hex edit of the lump to get it to look right, but there's an easier and quicker method: Image->Save as Doom Flat. Now it should be on the top left corner instead of the middle; if that occurs, it's a flat now, and assuming the dimensions are 64x64 (maybe 128x128 too, but let's stick with what we KNOW works), you can now use the flat properly in MOO.WAD... well, once you add "F_END".
---
Skies? Make a SKYxx texture, with xx being the number you want (probably "2"), and make it like any other texture. Once you're done, you can use it in your map headers (just set "skynum=xx", or in this case, "skynum=2"). As the picture demonstrates, it does indeed work (see the DOOM sky up there?). That level in MOO.WAD will look plenty nice with a new sky, right?
---
Animation? You got it. You're going to need this pack.
Downloaded that? Good, it contains the command-line program that generates the ANIMATED lump required to have animated textures and flats (XWE won't do this for you, sadly), a very-much outdated .DAT file that tells it how to generate the file (see below for a better one, though I'll note that this is based on an older version of SRB2 - I'll need to go hunting in the source code for the new lump), and a shortcut that will generate the lumps for you.
So how do you tell it to animate things? Easy. Make a copy of the existing DAT file (again, use the stuff provided below, not what's in the ZIP), so you don't mess up the original. 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 LAST in the loop, and the first tells it which texture is FIRST in the loop (yes, last and first are backwards... get used to it).
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.)
Anyway, the DAT file you'll need is here, courtesy of Jason. As I said earlier, though, this version is slightly outdated; I'll need to make a new one.
---
Now go, and hopefully you can make some nice textures for us (or at least yourself) to use!
Thanks to hotdog003 for giving me a441's tools, and a441 for making them in the first place; without those, XWE would be as useless as AJ always says it is. Also thanks to JTE for the more-better DAT file for the ANIMATED lump.
---
Nearly two years ago (as of the latest edit of this post), I decided to register with you guys to see what I could do about getting custom textures to work. The problem was, the tool I was using (XWE) misinterpreted TEXTURE1, causing all sorts of problems.
A small ray of hope was there, though, as a441 had made tools that worked, and worked well, at converting PNAMES and TEXTURE1 to something that was editable in Notepad. After the four months (ie: the past weekend) I finally managed to secure a copy of those tools, for my own perusement and so forth.
Well, first off, yes, it worked:
But there was an interesting side-effect... XWE was reading TEXTURE1 properly! I confirmed this by converting the lumps to text and back and giving them their own wad, and then setting XWE up so my IWAD was SRB2.WAD; all the textures displayed properly, and with some exceptions (mostly skies, though they still work properly).
Well, obviously, I had to prove this was working A-OK, so I whipped up some old textures I'd ripped from SMB2 (the US one), and tried adding them on to TEXTURE1 and PNAMES... and wouldn't you know it, it worked!
---
But I digress. You're probably waiting for the point of this topic, and I'll be blunt: this is a quick tutorial on how to get custom textures working in SRB2 using XWE. No pictures for now, so follow closely.
First off, you'll need these:
The latest version of the eXtendable Wad Editor
A zip with the valid TEXTURE1 and PNAME lumps in it
A texture to work with; width must be a power of 2 (like 32, 64, 128 and so forth), height must be 255 pixels or less (but it can be anything else otherwise; for taller textures, split it up into multiple textures of, say, 128 pixels height), and for ease's sake, put it in DOOM's 256-color pallette! (The .GIF file should have the right pallette, if I'm not mistaken.)
Yeah, that's pretty much all you need.
---
So how do you get started, you ask? This is easy.
First, open XWE. It'll most likely prompt you for your IWAD; attempt to point it at SRB2.SRB. If it complains, point it to your commercial DOOM2.WAD, and if you don't have that, download FreeDOOM. You can edit the INI later on to point to SRB2.SRB, assuming you know what you're doing (remember, kids, BACK UP FIRST!)
Now, make a new WAD - "MOO.WAD" for example - and insert the valid TEXTURE1 and PNAME lumps. Assuming it still works like it did in the past, it should work perfectly - no random textures with "W" at their ends.
Now, go to Entry->New. Type in "P_START" and hit Enter. You should now see a third lump with the filetype "MARKER". If you don't, something screwy is afoot, delete this lump and try making it again.
Now, Entry->Load. Head over to your texture file and select it. Rename the lump name if necessary (eight characters, folks!). You should now see your texture in the list, and on the right, amongst the cyan, your texture should be clear as day. Congrats, the patch is loaded! But don't start using it in your levels yet, it won't work that easy.
If you have more textures to add (or you're making a big texture but lack the other pieces of it), add them now. If not, then Entry->New, and type in "P_END". This closes off the patch section.
So how do you use these? Good question. Really simple answer, too. Right-click the texture and select "Add to Patch Names" and "Add to Texture", in that order. The patch name is now in PNAMES, and if you select TEXTURE1, your patch will now be in a little box shaped its size. For most intents and purposes, NOW your texture is usable in SRB2. Go ahead and create a level in MOO.WAD using it. (Unless you were making BIG textures, in which case, you'll notice there's a problem. Delete all the parts of it besides the top part from TEXTURE1; I'll explain how to fix this in a bit. Read on.)
---
So what does all this jargon on the upper-right that displays when TEXTURE1 is selected mean, anyway? Well, on the left of the top bar is the list of all the textures. If you want to make a new one, just hit Insert (or Textures->New). Make that texture name, oh, say, "MARIOVIN" with dimensions of 128 by 128.
So, this brings us to the right part of the window. The patches. See, the files you loaded weren't the textures themselves; they're known as "patches", only PART of the whole, which are added one-by-one to make the texture. If you're planning on making large textures, as I've been mentioning for a while, this is a key thing to learn, so, here, I want you to do Textures->New Patch. Fill in the PID for this to 74; this corresponds to its position in PNAMES, so if you need future reference for patch IDs, turn to that lump. Anywho, you should now have a Mario block.
...been there, done that. So now, make another patch (still Textures->New Patch), but this time use a PID of 125. Now you have a Mario block, with one corner with vines on it. Simple, neh?
Repeat that last step three more times, but make the coordinates for each VINE2 (64,0), (0,64) and (64,64) respectively - those should be the other boxes, previously both 0. Now all four corners should be covered with vines. Textures->Save (or try leaving, XWE's pretty good at nagging you about saving). Now you have yet another texture to toy around with.
So, as I've said, you can use this to create REALLY BIG textures. Make it as big as needed - probably tall, if you were making a 256x256 texture - and then just use multiple patches to fill up the black, and you should be fine. Hey, if Zim's Base can do it, why not you?
I'll note that this is why I had you split tall textures up - it creates multiple patches with which you can create a single texture. Tall patches corrupt the bottom-most line of the patch, which is not good by any stretch of the imagination. Thus, two 128-tall patches working together to make one 256-tall texture is BETTER than one single 256-tall patch, but anything smaller can be done just as easily with one patch. Follow? I hope, but do feel free to ask.
---
Now, flats. What level is complete without them? Admittedly I've not done much experimenting here, but mostly everything I've tried thus far works, so bear with me.
Add "F_START". Now, select "Floors" at the list of buttons on the bottom. Now, Entry->Load whatever you want to use as a flat. You'll see the image, but you're not done yet! It's usable, but it'll look all corrupted. a441 often suggested doing some weird hex edit of the lump to get it to look right, but there's an easier and quicker method: Image->Save as Doom Flat. Now it should be on the top left corner instead of the middle; if that occurs, it's a flat now, and assuming the dimensions are 64x64 (maybe 128x128 too, but let's stick with what we KNOW works), you can now use the flat properly in MOO.WAD... well, once you add "F_END".
---
Skies? Make a SKYxx texture, with xx being the number you want (probably "2"), and make it like any other texture. Once you're done, you can use it in your map headers (just set "skynum=xx", or in this case, "skynum=2"). As the picture demonstrates, it does indeed work (see the DOOM sky up there?). That level in MOO.WAD will look plenty nice with a new sky, right?
---
Animation? You got it. You're going to need this pack.
Downloaded that? Good, it contains the command-line program that generates the ANIMATED lump required to have animated textures and flats (XWE won't do this for you, sadly), a very-much outdated .DAT file that tells it how to generate the file (see below for a better one, though I'll note that this is based on an older version of SRB2 - I'll need to go hunting in the source code for the new lump), and a shortcut that will generate the lumps for you.
So how do you tell it to animate things? Easy. Make a copy of the existing DAT file (again, use the stuff provided below, not what's in the ZIP), so you don't mess up the original. 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 LAST in the loop, and the first tells it which texture is FIRST in the loop (yes, last and first are backwards... get used to it).
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.)
Anyway, the DAT file you'll need is here, courtesy of Jason. As I said earlier, though, this version is slightly outdated; I'll need to make a new one.
Code:
# ANIMATED defaults for SRB2
# by Jason the Echidna
# Speed is how many tics before the next frame of
# animation. (So a speed of 8 is slower then 2 because
# it waits 8 tics before switching to the next frame.)
# Last is the last frame in the animation.
# First is the first frame in the animation.
# This list is a perfect replica of the one in SRB2's
# source code, right down to the commenting. But I
# took the time to do the boring work of putting it
# in the format below, SO YOU'D BETTER FIND IT USEFUL.
[SWITCHES]
# There are no switches in SRB2.
[FLATS]
#speed #last #first
4 NUKAGE3 NUKAGE1
4 FWATER16 FWATER1
4 BWATER16 BWATER1
4 LWATER16 LWATER1
4 WATER7 WATER0
8 SWATER4 SWATER1
8 LAVA4 LAVA1
8 BLOOD3 BLOOD1
#speed #last #first
8 RROCK08 RROCK05
4 QUIKSN16 QUIKSN01 # Quicksand
4 CHEMG16 CHEMG01 # THZ Chemical gunk
4 GOOP16 GOOP01 # Green chemical gunk
4 SLIME08 SLIME05
2 THZBOXF4 THZBOXF1 # Moved up with the flats
2 ALTBOXF4 ALTBOXF1
#speed #last #first
4 BLUE3 BLUE1
4 GREY3 GREY1
[TEXTURES]
#speed #last #first
2 GFALL4 GFALL1 # Short waterfall
2 CFALL4 CFALL1 # Long waterfall
2 TFALL4 TFALL1 # THZ Chemical fall
2 AFALL4 AFALL1 # Green Chemical fall
2 THZBOX04 THZBOX01
2 ALTBOX04 ALTBOX01
4 SFALL4 SFALL1 # Lava fall
2 BFALL4 BFALL1 # HPZ waterfall
4 GREYW3 GREYW1
4 BLUEW3 BLUEW1
4 COMP6 COMP4
4 RED3 RED1
4 YEL3 YEL1
---
Now go, and hopefully you can make some nice textures for us (or at least yourself) to use!
Thanks to hotdog003 for giving me a441's tools, and a441 for making them in the first place; without those, XWE would be as useless as AJ always says it is. Also thanks to JTE for the more-better DAT file for the ANIMATED lump.