Pick up the crowbar of research scientist Gordon Freeman, who finds himself on an alien-infested Earth being picked to the bone, its resources depleted, its populace dwindling. Freeman is thrust into the unenviable role of rescuing the world from the wrong he unleashed back at Black Mesa. And a lot of people, people he cares about, are counting on him.

Post tutorial Report RSS Getting a texture In-Game

So you finished your texture? Time to get it into Half-Life 2!

Posted by on - Basic Textures

[page=Importing a Texture]
Before saving your texture make sure it is a power of 2 (256, 512, 1024, ect.). The most common is 512px, but you can make it bigger if you want more detail. Save the file as a .TGA (Targa) in the folder C:\Program Files\Steam\SteamApps\Username\sourcesdk_content\gameshortname\materialsrc and run it through Vtex.exe (for instructions go here).

Now move your newely created .VTF file into C:\Program Files\Steam\SteamApps\Username\half-life 2\hl2\materials

Now you will create the .VMT text file which tells the game how to display it. Open up notepad and type:

"LightmappedGeneric"
{
    "$basetexture" "your texture"
    "$surfaceprop" "surface"
}

Replace "your texture" with the name of your .VTF texture file, without the .VTF extension or the 'materials' folder.
For example, a material in materials/wood/wood1.vtf would become wood/wood1
Replace "surface" with the type of surface the texture is. Choices are:

  • metal
  • paper
  • wood
  • concrete
  • glass
  • brick
  • tile.

Save the file as *your texture name*.VMT in the same folder as the .VTF

The final product would look something like this. In this example the file is "wood1.vtf" and it is in the "wood" folder in the base material directory.

"LightmappedGeneric"
{
    "$basetexture" "wood/wood1"
    "$surfaceprop" "wood"
}

Your all done now :) You can go Hammer and search for your texture and it will come up. Hope this helps with you mod/map. Contact me with any questions.

Post comment Comments
MrSmiley92
MrSmiley92 - - 32 comments

Thanks man. I needed help on how to do this. Good job.

Reply Good karma Bad karma+1 vote
mo2k7
mo2k7 - - 16 comments

(Second post Woo) and i didn't know how to this it was quite frustrating, thanks

Reply Good karma Bad karma+1 vote
RickRedler
RickRedler - - 10 comments

I had problems in the vmt but this tut helped me.. Thanks.

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: