Adding your custommade textures - tutorial for noobs


(Flippy) #1

Hey all… just because i was bored and saw a few questions about adding your own custtommade textures to ET and getting them to work, here is a little ( :open_mouth: how dare i call it little! :smiley: )tutorial i wrote…
Note that it’s VERY detailed and therefor aimed at newbies…
Here it is:

Using your own textures in GTK Radiant for n00bs (like me lol)
For Wolfenstein Enemy Territory
By Flippy

In this tutorial i will try to teach you how to use your own selfmade (or stolen =P) textures with GTK Radiant, for Wolfenstein: Enemy Territory (but it might also work for Quake or other games, you will have to try it yourself as i don’t have these games.)

Programs needed:
Gtk Radiant (I’m using 1.4 and never used any other version so it might work a little different in other versions)
Text editor like wordpad
WinRAR (or WinZIP)
And the game ofcourse…

!! Always use a clean install of ET for mapping, so you don’t accidently use custom textures other people might not have or get other problems…!!

Step 1, checking the size and filetype and putting your textures in the right directory.

1a. First take a look at your picture you want to use for your texture. Make sure that it’s size is a power of 2. This means the size (width and height) should be either 2, 4, 8, 16, 32, 64, 128, 265, 512, 1024 etc (but more than this is a bit big i guess lol).
It does not mean that the picture has to be a perfect square. For example, a picture with width: 128 and height: 512 will work.
Also make sure that the picture is either a .jpg or a .tga. I’m not sure if you can use other types but those 2 will work for sure.

1b. If you have the right size, then it’s time to put the picture in the right directory.
Let’s assume your map is called “Test.map”.
Go to your Wolfenstein ET directory (normally “…Program Files/Wolfenstein - Enemy Territory”) and go to the “etmain” directory.
If you see a directory called “textures”, skip to step 1d. If you don’t see this directory, read on.

1c. To put your textures in a directory ET and GTKradiant can read, you have to extract the contents of “pak0.pk3” to your etmain directory. To do this, you need a program called WinRAR (or WinZIP) . (You might want to use other programs but winrar works just fine)
You can get WinRAR for free, search for the word “winrar” on www.google.com and you will find it if you don’t have it already.
When you installed WinRAR, rightclick on “pak0.pk3” and choose “extract here”. This will extract a number of files and directories to your etmain directory. If all is well, you should at least have the following directories in etmain now:
-maps
-scripts
-textures

1d. Open up the directory “textures”. You will probably see that there are a large number of directories in there, all using different map names. If your “textures” is empty, you might want to read step 1c, although I’m not sure if it’s needed.
Make a new directory in “textures” with the name of your map. In our case, we create the directory: “…etmain/textures/test”
Put your textures in this directory.

Next step is to create the shader file for your texture(s) so ET and radiant can read them.

Step 2, creating the shader file.

2a. Remember the name of your texture(s) in “etmain/textures/test”. I assume for this tutorial that you have made 2 textures called “text1.tga” and “text2.tga”.
Now go back to etmain and go to the “scripts” directory. The first thing you do here is open “shaderlist.txt” with notepad or wordpad or whatever. This is a list of all shaders which is used by Gtk radiant.
Put the name of your map (which should also be the name of your textures folder and also the name of your shader file (later on) ) in this list. I always do this in the right place using alphabet sorting.
Assuming again that your map is called “Test.map” a part of our shaderlist.txt must now look like this:

skies_sd
snow
snow_sd
sprites
stone
swf
temperate_sd
terrain
test
textures
tobruk_wall_sd

Make sure to save the file before closing.

2b. Now we have to make a new shader file for your textures.
Stay in “etmain/scripts” and open up your text editor (again lol).
For this tutorial i will use basic shader commands. The more advanced commands like blending are not covered here for the simple reason that im still a noob at it and dont understand it lol…

Right… In your text editor, you might want to start with listing the name of your map and your name or something… this is not needed but it adds personality imo… (and i can teach you how to use comments =P)
Because ET and GTK radiant don’t need this information, you put the text behind 2 slashes.: “// [text]” ET and GTK will not read the part behind these slashes.
In our case, you start with typing something along the lines of this:


//Shader file for "Test.map"
//By [yournamehere]

Now the real shader starts. The first thing you do is name the shader, by typing the path of the texture you are going to write the shader for. Confused yet? Here is an example:
Remember our texture names? The first one was called “Text1.tga” and it was in “etmain/textures/test”
ET doesn’t need the “etmain” part, so our path will be “textures/test/text1” (remove the .tga part here)
Example:


//Shader file for "Test.map"
//By [yournamehere]

//Texture 1, test texture

textures/test/text1

Now you need to add shader commands for the shader to work.
We will use the default shader commands.
The first thing we put after the shadername is the editor image path. This is the file used by GTK radiant (NOT always BY ET) when showing you the texture.
We add a “qer_editorimage [pathname]”
Assuming our texture is a metal like texture, we need it to sound metal like when you walk on it ofcourse. This is done by using “surfaceparm metalsteps”
There are more surfaceparms such as “slick”(ice) “wood” (wooden sound) etc…
The surfaceparms (and other commands) have to be between { } thingys to work. “{” being the “opening” of the shader commands, “}” the closing.
Example:


//Shader file for "Test.map"
//By [yournamehere]

//Texture 1, test texture

textures/test/text1
{
	qer_editorimage textures/test/text1.tga  //Use the .tga or .jpg extension here!
	surfaceparm metalsteps
}

Congratulations, you just made your own shader :slight_smile:
Now for the second one do the same.
This time however, we assume the second texture is a semi-transparant texture. Note that I don’t show you how to make the texture semi-transparant in ET, but only in GTK. Doing it in ET requires a bit more knowledge i don’t have. =) Im just showing you how to do it in radiant for fun… lol
The command for this is “qer_trans [value]”
Our shader will now have to look like this:


//Shader file for "Test.map"
//By [yournamehere]

//Texture 1, test texture

textures/test/text1
{
	qer_editorimage textures/test/text1.tga     //Use the .tga or .jpg extension here!
	surfaceparm metalsteps
}

//Texture 2, test texture 2
textures/test/text2
{
	qer_editorimage textures/test/text2.tga
	surfaceparm metalsteps
	qer_trans 0.5   // This texture will be half visible IN GTK RADIANT, NOT in ET
}

Now your shader file is done, you just have to save it (step 2c).

2c. Saving your shader file can be tricky as notepad tends to add a “.txt” extension to everything.
Choose File - Save as and go to the directory where your shader needs to be saved, which is “etmain/scripts”
Now in the “name” field name the texture “test.shader” INCLUDING THE " ".
Choose as filetype “All files”

Step 3, using the texture in gtk radiant

3a. Open up GTK radiant and open your “test.map” file. If GTK was already open, close it and open it again or choose “textures - flush and reload shaders”. Now go to “Textures” at the top and scroll down and choose “test”. Press “T” if you don’t have a textures window. Your textures should be in here.
Add them to some brushes and compile the map.

Voila, there you are, custom made textures are easy, (even if i wrote half a book about it now lol)

I hope i didn’t make any mistakes (more than likely that i did lol). If so, please tell me…
I also hope it works for everyone LOL

Now im tired
Bye


(]UBC[ McNite) #2

Very well explained tutorial… I wish there had been something available like this when I was starting to map. I especially liked that you pointed out some basics (clean install, unpacking) which can’t be mentioned often enough. And its really a clean step-by-step introduction. Nice work!

I have some minor remarks:

For understanding all kinds of shader parameters read the Shader Manual, it explains a lot.

Programs needed: Winzip works fine too.

Step 2: You do not necessarily need a shader for a new texture. For example a new stone texture is just fine without a shader. But as soon as you need settings that go beyond standard, you need a shader which defines those settings, like different sounds for walking on the surface (the stone-sound is standard sound).

3a) You don’t need to restart the Radiant. Go to textures menue and select “flush and reload shaders”. Your changes on shaders are loaded by that.


(Flippy) #3

thnx alot for your comment, it only helps to improve it :slight_smile:

but i thought you needed a shader for a texture to work? is this not true?! weird… then how come i got the yellow and black texture always before i knew about shaders? :smiley:
i will add some things to the tut now…


(*PM|Sypher) #4

that was extremely confusing…so i guess ill learn that later


(SCDS_reyalP) #5

You also don’t need to extract pak0.pk3, although it is convenient to be able to browse through the existing textures. You should also add your texture directory name (which should be the same as the shader name) to scripts/shaderlist.txt. So if you made a shader called
textures/test/test1 or created a texture called in textures/test/test1.jpg

you would add the single line
test
to your shaderlist.txt

You should not distribute the shaderlist.txt with your map. It is only used by the tools.


(sodsm live) #6

there are a few things that cause that. the most common occurance i’ve found is when the new custom shader-less image is not a power of 2. check the console for the error as it usually tells you what’s wrong(it’ll either say “image not power of 2” or “shader image not found” or something along those lines). i don’t know what happens when an image has the same name as an existing shader as i always name my shaders in a particular way.

Edit:

reyalP beat me to the extraction thing