<< ModelChanger

Tutorial - Reskinning CSS Player Models for use with Model Changer plugins
 

This tutorial will take you through the process required to compile CSS player models that point to a new location for their textures (skins).

 

You can use this same method for complete models. Instead of decompiling the standard models from the Steam cache in Step 4, decompile the custom model you downloaded.
 

Tools Required

 

Step 1

Locate the skin you will be using and copy the vtf/vmt files to the following directory:  ...\Steam\SteamApps\USERNAME\counter-strike source\cstrike\materials\player\yourname\skinname_v1

 

The version at the end is important, because if Valve changes things and you have to update your model, YOU MUST USE ANOTHER NAME or clients will not download the new model. I will be using Darkelfa's Urban City CT for this example so I copied the files to ...\Steam\SteamApps\LDUKE\counter-strike source\cstrike\materials\player\lduke\urbancityct_v1

 

 

Step 2

Each Valve material is made up of multiple files: vtf image files containing the texture, bump map, specular map, etc and vmt text files containing additional information in about the material such as surface type.

 

Darkelfa's CT skin comes only with the vtf files, so we need to get the original vmt files from the Steam file cache. Start GCFscape and open the file ...Steam\SteamApps\counter-strike source shared.gcf.

 

Copy the vmt files (ct_urban.vmt and ct_urban_glass.vmt) from materials/player/ct_urban to the directory where you put the vtf files in step 1.


 

 

 

Step 3

The vmt files describe where texture files are located so we need to change that. Open them in  a text editor and change the paths to match where your new vtf textures are located. Any textures that are not being replaced should be left alone in the text file so you don't have to add them to your downloads.

 

For example, change ct_urban.vmt from this

"vertexlitgeneric"
{
"$baseTexture" "models/player/ct_urban/ct_urban"
"$envmap" "env_cubemap"
"$bumpmap" "models/player/ct_urban/ct_urban_normal"
"$normalmapalphaenvmapmask" 1
"$envmapcontrast" 0.3
"$envmapsaturation" 0.7
"$envmaptint" "[ 0.36 0.36 0.36 ]"
}

to this

"vertexlitgeneric"
{
"$baseTexture" "models/player/lduke/urbancityct_v1/ct_urban"
"$envmap" "env_cubemap"
"$bumpmap" "models/player/lduke/urbancityct_v1/ct_urban_normal"
"$normalmapalphaenvmapmask" 1
"$envmapcontrast" 0.3
"$envmapsaturation" 0.7
"$envmaptint" "[ 0.36 0.36 0.36 ]"
}

 

and change urban_glass.vmt from this

"vertexlitgeneric"
{
"$baseTexture" "models/player/ct_urban/ct_urban_glass"

// Specularity
"$envmap" "env_cubemap"
"$envmapmask" "models/player/ct_urban/ct_urban_glass_spec"

// Transparency
"$translucent" 1
}

to this

"vertexlitgeneric"
{
"$baseTexture" "models/player/lduke/urbancityct_v1/ct_urban_glass"

// Specularity
"$envmap" "env_cubemap"
"$envmapmask" "models/player/ct_urban/ct_urban_glass_spec"

// Transparency
"$translucent" 1
}

Notice that I did not change the path to ct_urban_glass_spec.vmt since Darkelfa's skin did not include that texture file.

 

 

Step 4

Make sure you are logged into steam. Copy the Cannonfodder's mdldecompiler.exe to your ...\Steam\SteamApps\USERNAME\counter-strike source\bin directory and double click on it. We need to decompile the player model so choose either the urban or terrorist mdl file as the "Model File" and choose a temporary "Output Directory" where the decompiled files will be saved.

 

 

 


Step 5

Use a text editor (like notepad) to open the mdldecompiler.qc file.

 

Find the line:

$modelname "player/urban.mdl"

and change it to your model name:

$modelname "player/lduke/urbancityct_v1/urban.mdl"

 

Find the line:

$cdmaterials "models\player\ct_urban\"

and add your materials path to THE LINE ABOVE IT:

$cdmaterials "models\player\lduke\urbancityct_v1\"

$cdmaterials "models\player\ct_urban\"

Adding the new path instead of replacing the old one means that any textures your skin does not include will still be located in the steam cache files.

 

 

Step 6

You're ready to compile. You need to run ...\Steam\SteamApps\USERNAME\sourcesdk\bin\studiomdl.exe with the mdldecompiler.qc file as the input. The easiest way to do that is to paste this into a text file, edit it to match your paths, and save it as compile.bat.  Double-click on the bat file and a text window will appear displaying information as it compiles your model.

 

 

Step 7

Check to see if it compiled correctly. Click on Steam > Play Games > Source SDK > Model Viewer. Open your model (in this case models/player/lduke/urbancityct_v1/urban.mdl) and make sure it loads correctly.

 

 

 

Step 7

Create any setup files required by your plugin (check the documentation).

 

 

Questions? Problems?

Post them in the L. Duke forums.


 

 

 

 

 

<< back to ModelChanger