Sunday, December 7, 2008

Lesson 11 - Custom Textures

Now I am going to show you how to make Custom Textures. There is probably more than one way to make textures. There are a lot of tutorials online. I found them to be very complicated. They say something about using a program called Vtex. I have tried to use that program but it never worked for me.

If you are New to Mapping Click this link and start at the beginning.

(The easiest way to make textures is to use VTF edit, get it from the links below, on this page!!
just click file/import, import the pic, save it as .VTF, click tools/make .vmt, restart hammer and you're done.)

or you can do it the complicated way.

In order for you to do this correctly. The need to be able to see file types. You know, ( .jpg , .bmp , .txt , .mp3 , ect.)

To do this, open any folder. Click on tools, go down to folder options.

In the "folder options" dialog box, click on the "view" tab. Look for the box that says, "hide extensions for known file types". Take the checkmark out of this box. Click OK. Now you should be able to see file extensions.

NOW you need to download an editing program. One called VTFedit and also .NET Framework . VTFedit will not work without .NET Framework. You need to install .NET Framework before you install VTFedit.
You can get .NET Framework from Microsoft. Click on the link below. After you install .NET Framework you will have to reboot your computer.
.NET Framework
You can get VTFedit from here. look for "Installer (850 KB)"
Install .NET Framework.
Install VTFedit
Now we need to convert your pic file into a .vtf - (Valve Texture File)

I will show you how to make a custom texture, using the custom spray feature, in DOD source. This is a typical DOD room. (See p1)

First, you need to select the textures you wish to use. (see p2)

You have to make sure the photographs you wish to use are the correct sizes. They have to be 256, 128, 64, 32, 16, 8, 4, or 2 Pixels wide.

Then you need to open DOD, to the game menus. And select options. (see p3)

Then click multiplayer. (See p4)

Then click import spray. (See p5)

Browse to where the picture is that you want to make a texture out of. Select the picture, then click open. (See p6)

After that, you should see the image you selected appear in the window called "spraypaint image". (See p7)
If you see that, then you are ready for the next step.
We need to find, on your computer, the texture files we just created. To do this, you need to take note of the name of your texture file. My texture in this example is called, pups-carpet_floor. (See p7)

Click the start button. Right click on "My Computer". Select search. (See p8)

Click All files and folders. (See P9)

Search for the name of the texture, you just made the spray out of.
1. Insert the name of your spray.
2. Make sure it says search local hard drives.
3. Click search
(see P10)

You should have 2 files. .vmt and .vtf (See p11)
.vtf file -is the picture
.vmt file -contains the information about the texture, like is it wood, is it metal, so steam knows whether to show sparks or splinters when your texture is shot that type stuff. It also contains information about where the texture is located. And because we are going to move these files. We have to edit the location.

In my example p11 you can see more than two files. The ones we are concerned with are the ones in the logos folders. Not the logos/ui folder. (See p12)

Right click on the correct file, and select "Open Containing Folder". (See p13)

This will bring you right to the logos folders, where the texture you just created is located.

Select your two files, and hit "ctrl c". To copy them to the clipboard. (See p14)

Click the "up folder" button two times. (See p15)
you should be in the ...\day of defeat source\dod\materials folder.

You need to create a folder, in this folder. Usually it will be the same name as the name of your map. But for this lesson, to keep it simple, I'm going to name my folder SB.

...\day of defeat source\dod\materials\sb

Open the new folder you created, and click ctrl-v, to paste the texture files. (See p16)

Now open the .vmt file in VTFEdit. You should see something that looks like this. (See p17)

The line that says "$basetexture" is the file location.
and The line that says "$decal" is some setting.

We have to change "$basetexture" , to reflect the new location that we moved our textures to. Also we have to change "$decal" from "1" to "0", so your texture will not be transparent. (See p18)

Change it.
Save it, and close it.

Now you should be ready to open Hammer and apply your new texture.
You might have to restart Hammer. If it's open.

I went ahead and added some more custom textures, the same way as I did the last.

One more thing you need to know, for your map to work right on your server. You will need to upload your "map file" with a ".res file".
A .res file is just a text file that tells the server where to find and download the custom textures to clients, when they join your server.

Also, a .res file should have the same name as your map file.
Example: if your map's name is "dod_further.bsp" then your .res file should be named "dod_further.res"

And you place the .res file in the same folder you place your map's on your server.

This is what is in a .res file. (See p19)

And you need to make a folder on your server just like the one you made on your computer.
...\day of defeat source\dod\materials\sb
and place your textures in that folder, so people can download them when they join.

I went ahead and added some more textures, and a World War II picture I downloaded off the Internet. Just to show you an example of how you can get a totally different look. (See p20)

Note: all the texture files you create using this lesson, will be created in the logos folder. So if you plan on making alot of textures, you should make a shortcut to that folder on your desktop. Then you will not have to search for the texture every time you create a new one. Or you can just browse to that folder if you like.

(Note: you do not have to do the following procedure if you're going to use .res file.)

Additional: if you are an advanced mapper, then you can take it one step further. You can eliminate the need for a .res file, by embedding your texture files into your .bsp after it is compiled.

Here is what you need, to avoid missing textures, which show up as pink checkerboards.
What you'll need:
you'll have to install java runtimes,
You can get them here.
Java Runtimes
PakRat for Source -
PakRat is a post compile process for embedding your custom materials into your map. If you need instructions on how to run Packrat , then follow the instructions on their web page. Or you can do what I tell all my friends, "Google it!"- I said you can use this if you are an advanced mapper.

I have never used it. So I can't answer your questions about it.

GOTO Lesson 12 - Advanced Displacements