Team Fortress 2

Team Fortress 2

Not enough ratings
TF2 Weapon Skin information
By Thirteen
The new system for TF2 weapon skins comes from the land of CS:GO but there is no tool or system that allows the crafty among us to make their own properly, as of this writing. This guide is more a workaround for the end user while explaining what's going on.
   
Award
Favorite
Favorited
Unfavorite
The basic material
The new system for TF2 weapon skins comes from the land of CS:GO but there is no tool or system that allows the crafty among us to make their own properly, as of this writing. This guide is more a workaround for the end user while explaining what's going on.

When you use one of the skinned weapons in game, I'll refer to a minigun for discussion, the engine loads first the default material for the minigun:
materials/models/weapons/c_models/c_minigun/c_minigun.vmt

now at the bottom of the material is a new reference in the proxies:
"WeaponSkin"

It's currently empty of options in all the weapon materials, but I imagine this is the 'hook' telling the engine to look for additional info on a potential weapon skin. I have no idea where it does this, but it's at runtime and more than likely doesn't matter for our needs at the moment.

Because there is also a new text file that organizes all the weapon skin variables.

Under: tf/scripts/items

you will find: paintkits_master.txt

This is a bulk text file that Valve generates with a python script. It's pretty large, but the individual weapon sections are pretty straightforward.
The Paintkit Master
When you open the master text file, it's all very human readable and searchable. Here is a clip of section for the Antique Annihilator Minigun, Factory New Condition. I'll walk thru it making comments on the important bits after each of them.

// ********************************************************************** // craftsmann_minigun_antiqueannihilator.paintkit // ********************************************************************** "craftsmann_minigun_antiqueannihilator" { "wear_level_1" // this is wear condition level, every skin has 5 sections. This example clip is only showing the first wear level. In the actual text file, there is 4 more just like this, with different wear settings. { "combine_multiply" // this is a multiply, just like in photoshop. this section applies the lighting to the weapon and any potential blood or dirt thaty the engine has applied to the weapon. { "texture_lookup" { "texture" "models/weapons/c_models/c_minigun/c_minigun_ao" // the ambient occlusion texture for the weapon } "texture_lookup" { "texture" "patterns/paint_dirt" // basic dirt pattern texture "rotation" "0 360" "translate_u" "0.0 1.0" "translate_v" "0.0 1.0" "adjust_black" "0" // this value at 0 will makes sure the automatic scratches and blemishes doesn't effect this texture at this quailty version. The further down the quailty levels, the black values get bigger "adjust_offset" "0" "adjust_gamma" "1.0" } "texture_lookup" { "texture" "patterns/paint_blood" // basic blood pattern "rotation" "0 360" "translate_u" "0.0 1.0" "translate_v" "0.0 1.0" "adjust_black" "0" // same as above. "Black" amount equals the auto-wear amount. Any blood or dirt the system applies to the weapon will not be effected by the wear with "0" as the value "adjust_offset" "0" "adjust_gamma" "1.0" "scale_uv" "0.4 0.5" } "combine_lerp" // this section is several stacked lerps. this is defineing the color section of the weapon and what goes where on the model. { "combine_lerp" { "combine_lerp" { "texture_lookup" { "texture" "models/weapons/c_models/c_minigun/p_minigun_albedo" // this is the color of the weapon without any lighting or shadows. The material is going to combine it with the other texture in this lerp } "texture_lookup" { "texture" "patterns/craft/woodgrain_05" // this is the first new texture, a wood grain pattern "adjust_black" "0.0" // no wear, this is factory new version "adjust_offset" "178.5" "adjust_gamma" "1.5" } "select" // this is a new texture that only has a greyscale image in the Red channel. Generally each of the UV shells of the weapon have been painted with a different flat grey scale color { "groups" "models/weapons/c_models/c_minigun/p_minigun_groups" // this references the selection mask image "select" "224" // this is the grey scale level [0-255] that's painted on the mask where the wood grain will be applied to the weapon. "select" "240" // this is another UV hull/area that is painted a different grey scale value, but will still get the same wood texture as it's also refrenced here. } } "texture_lookup" { "texture" "patterns/solid_orange_bright" // 2nd new texture, a solid orange color, it's not being combined here, just applied "as is" "rotation" "0 260" "translate_u" "0.0 1.0" "translate_v" "0.0 1.0" "scale_uv" "1.0 1.5" } "select" // this tells where to apply the orange texture { "groups" "models/weapons/c_models/c_minigun/p_minigun_groups" "select" "48" // this is the top handle of the gun, its painted a dark grey on the mask "select" "208" // this is the small adjustment knobs on the gun, painted a brighter white on the mask } } "combine_lerp" { "combine_lerp" { "combine_lerp" { "texture_lookup" { "texture" "patterns/solid_medium_grey" // another texture, solid grey and tilable } "texture_lookup" { "texture" "patterns/solid_green_grey_textured" // another texture, solid green grey and tilable, this is the lower body on the minigun "rotation" "0 360" "translate_u" "0.0 1.0" "translate_v" "0.0 1.0" "scale_uv" "1.5 2.0" } "select" { "groups" "models/weapons/c_models/c_minigun/p_minigun_groups" // here we have many different UV shells being selected, all different greyscale levels on the groups texture. "select" "32" "select" "48" "select" "64" "select" "96" "select" "112" "select" "128" "select" "144" "select" "176" } } "texture_lookup" { "texture" "patterns/craft/woodgrain_05" "rotation" "-10 10" "translate_u" "0.0 1.0" "translate_v" "0.0 1.0" "scale_uv" "2.0 2.5" } "select" { "groups" "models/weapons/c_models/c_minigun/p_minigun_groups" "select" "224" "select" "240" } } "texture_lookup" { "texture" "patterns/solid_orange_bright" "rotation" "0 260" "translate_u" "0.0 1.0" "translate_v" "0.0 1.0" "scale_uv" "1.0 1.5" } "select" { "groups" "models/weapons/c_models/c_minigun/p_minigun_groups" "select" "48" "select" "208" } } "combine_multiply" { "texture_lookup" { "texture" "patterns/paint_scratches" // this is where the wear settings start, generally unless you have a good reason, you'll want to mimic the wear level settings that Valve uses. "rotation" "0 360" "translate_u" "0.0 1.0" "translate_v" "0.0 1.0" "adjust_black" "0" // this is set to zero, so it will get no wear "adjust_offset" "0" "adjust_gamma" "1.0" } "texture_lookup" { "texture" "patterns/paint_scratches" "rotation" "0 360" "translate_u" "0.0 1.0" "translate_v" "0.0 1.0" "adjust_black" "0" "adjust_offset" "0" "adjust_gamma" "1.0" } "texture_lookup" { "texture" "models/weapons/c_models/c_minigun/p_minigun_wearblend" // this is the mask that tells the system where to blend in the wear on the weapon. Don't touch unless you got a good reason. "adjust_black" "0" "adjust_offset" "39" "adjust_gamma" "0.44" } } } } }
Wrap up: additional notes
Now with this information, you can pick any weapon you already have, no matter the wear level, and edit the settings in the various txt files and pack it up into a VPK as per standard proceedure. The game will then display your edited version obviously. This will allow you to test your skins without having to get a special or rare weapon to test against. A factory new might be a little easier to use, but that's only because the settings in the master file for factory new are at the top of each skin entry in the text file.

The various transforms that are avalible will allow you to place any texture onto the weapon at any angle or scale. It should help you place the patterned files exactly where you want in relation to the exisiing UV's. This with the selection masks or 'groups' should allow you to also mask out any part of the model per pattern to get your desired skin as efficently as possible.

Hopefully Valve will give us a proper skin tool this year or the next, but in the meantime you can get yourself started if you'd like to skin some weapons now.

Notes:

As you know, Valve isn't taking any new skins 'yet'. They are more than likely porting the CS:GO workshop skin tools/codepaths as of this writing. As that work happens, they are also building a body of textures, bodygroup masks and skins that will set the quaility bar for users.

With this in mind, if you want to make skins that will have a reasonable chance at getting choosen once they open the doors, here's some thoughts to help you "think like valve"

Try to not make new bodygroup masks, if at all possible. There's a handful already per weapon and Valve will always be as stingy as possible when it comes to these sort of textures.

Every new texture you add is negitive. Yes, you will almost always need to bring at least one new texture to your skin. That's not really a negitive but beyond that it adds up quick. Make sure you use the transforms to move and rotate your and Valve's exisiting texture[s] around rather than make new ones.

With the pallete of colors that Valve has already made you shouldn't have to make any new ones. Exisiting colors can be modified in the material to get a particular hue you might need. The same goes with all the textures in the /patterns directory. There is even some gradients in there. Use them first and foremost before making one yourself. You will spend more time with your material options than any TF2 system before this.

None of this specifically covers the topic of stickers, again the same idea from CS:GO. They are being used on some of the skins already. If there's any interest, I can explain update this information dump for them as well. They aren't very difficult to figure out and if this all made sense, you'll probably be just fine.



I'm totally down for updating or refining any information here that I've gotten wrong or could be explained better. Just chat with me in the comments below.
18 Comments
Pitchumi 18 Jul, 2018 @ 1:26am 
@Pte Jack
Maybe can you add me if you want more technical information about how to make texture for SFM. Because I will need to show you illustrations.
Pitchumi 18 Jul, 2018 @ 1:22am 
@Pte Jack

Good hi, you asking some very complexe things.
Firstly, you need to know the fact that paintkits_master is sadly no longer in use, but anyway Valve haven't changed the "select" system. I have already picked all the value from the master from my previous works :
"select" "32"
"select" "48"
"select" "64"
"select" "80"
"select" "96"
"select" "114"
"select" "128"
"select" "144"
"select" "176"
"select" "192"
"select" "240"
So, I don't know how TF recognize the color, I guess the system is a bit inaccurate in manner to having enough sensibility to detect the right group color. You can notice that there a limited amount of color, so you can trying to find these gradually from the darkest to the lightest.
Pte Jack 17 Jul, 2018 @ 10:38pm 
Thirteen, if you're still following this, I hope you can help me here.

I'm trying to recreate paint schemes so I might be able to bring them to SFM. The engine for SFM is too old to create these new texture schemes and we have to manually chop up the textures for the UVs in order to apply them to the weapons there.

However, I am not finding the color values reported in the Paintkits_master file in the colour templates for the weapons.

For example I bought the weapon you're using as an example in this guide in order to follow the process through and try to paint it properly. I brought the p_minigun_groups texture in to my paint programs. (they're listed below)

Pte Jack 17 Jul, 2018 @ 10:38pm 
When I try to find the template colours for the Woodgrain_05 texture (224 and 240) and I throw a mask by colour for those values at the texture, nothing is selected on the texture. (I've tried this using both the red template texture or by converting the template to grey scale and trying that).

If I use a colour picker on the images for the areas that are suppose to be selected from the colour mask for that texture, I get values of 216 (for 224) and 232 (for 240) reported by the picker. It doesn't matter what program I use the colour picker from (GIMP, Substance Painter, Swatcher, Howler or Kitra) and doesn't matter what format I load the image from (png, vtf or TGA).

Am I doing something wrong? If not, how is TF finding these areas using the 0-255 number in the script?

Thanks
Pitchumi 28 Oct, 2017 @ 5:33pm 
Maybe, I hope they will doing something because I was about finalising my Barmann minigun , now I can't do it. =/
Thirteen  [author] 28 Oct, 2017 @ 5:30pm 
ooh that is a different approach... it might be that they will allow skin submissions properly
Pitchumi 28 Oct, 2017 @ 5:26pm 
I already searched a lot, and nothing found. I think the system is just become server-side now. =/
Thirteen  [author] 28 Oct, 2017 @ 5:25pm 
I can't imagine they would have changed out the entire system. they probably implimented a new version of it with a different name/directory structure. I would suggest you pop open the files with GFCscrape and see if there is anything that looks like it. I dont actually have TF2 installed anymore, so i can't do much in the way of helping beyond guesses.
Pitchumi 28 Oct, 2017 @ 6:41am 
Paintkits_master seems to not working with the new update.
Pitchumi 20 Aug, 2016 @ 1:47pm 
combine_add and apply_sticker are hard to use.