Retexturing props

Mystic Monkey

L5: Dapper Member
Jan 24, 2011
224
12
I got two model-texture based problems. One involving props, the other involving capture point hologram.

So, I know how to replace default textures in TF2 (this tutorial helped) yeah haven't actually tried it on a TF2 default model, but I have with a custom model and it worked.

But for my map, I would like to use certain props that TF2 has, but with new skins, especially more than one.
I didn't want to replace TF2 default props skins as then I would see it throughout the game and those who want to play my map will not see it. Plus I want to add more than one skins to make team variants for both sides.

So through GCFScape I made copies of the models, assosiated files and skins I wanted to replace (update_poster001, update_poster002 from teaser folder and bannerflag from medieval folder) I put them in their own folders in my models and materials folder, gave them new names to make them more recognisable for Hammer, .vtf and .vmt, made sure to address the $basetextures properly and so on.
(update_sonic_poster001 and update_sonic_poster002 to all the .vtx, .vvd and .mdl)

Because flags and posters are flat and easy for novices like me to retexture, I reskinned update_sonic_poster002 default skin, I changed the .vtf and renamed it update_sonic_poster002.vtf and addressed update_sonic_poster002.vmt to where it can find the model in it's designated folder but for some reason the poster is still using TF2s default Mann.co texture for it.
"VertexlitGeneric"
{
"$baseTexture" "models/Mystic_Monkey/update_sonic_poster002"
}
I tried it again with the medieval C-point flag which is simply renamed bannerflag_sonic and saving over it's default .vmt before renaming it and re-addressing it.
But still it's using default TF2 textures despite being a renamed copy, in a new folder, with it's own skins addressed to it.

If this can't be resolved, I'll resort to just making them overlays, but given they would be too flat to be posters and flags I hope it won't be.
 
Last edited:

Crowbar

aa
Dec 19, 2015
1,455
1,298
I think you need to recompile the model for it to use more skins, or ones from different files.
 

Tumby

aa
May 12, 2013
1,087
1,196
(update_sonic_poster001 and update_sonic_poster002 to all the .vtx, .vvd and .mdl)
You can not rename model files. The .mdl is basically a list of all the other files, and if you rename or move those, it can't find them anymore. It also stores where to search for the material files, which you can't change by simply renaming. Appart from figuring out how to edit a .mdl with notepad, you have only the following choices:
  1. Accept to only use the number of skins the model has and simply tell the .vmt to use a different basetexture. Then, pack the .vmt and .vtf into the map. The .vmt can not be in a different file path as the original.
  2. Decompile the model and recompile it again with a different name, model path, material path, and skin count. This gives you the most control. Also, loading a file over another can be glitchy anyways, so this is much more consistent. Obviously, this also requires much more work.
 

Mystic Monkey

L5: Dapper Member
Jan 24, 2011
224
12
Appart from figuring out how to edit a .mdl with notepad
I could try the notepad option... looks easy.

>Hammer crashes when loading map.

Damn. And since I dunno much about compiling models, all I can do is flat overlays which look too flat to be posters or flags.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,699
2,581
Also, TF2 sometimes does and sometimes doesn't accept packing a modded version of a stock model into the map. I know for a fact it doesn't work for item pickups; dunno about static props.
 

Tumby

aa
May 12, 2013
1,087
1,196
Also, TF2 sometimes does and sometimes doesn't accept packing a modded version of a stock model into the map. I know for a fact it doesn't work for item pickups; dunno about static props.
I already mentioned that with
Also, loading a file over another can be glitchy anyways, so this is much more consistent.


I could try the notepad option... looks easy.
It's the exact opposite of easy. You are basically playing around with 0s and 1s if you want to edit a file like this.


And since I dunno much about compiling models
Well, you know, you could always just ask for help or even have somebody do it for you.
 

Mystic Monkey

L5: Dapper Member
Jan 24, 2011
224
12
Well, you know, you could always just ask for help or even have somebody do it for you.
I know, I just hate how inaccessable at times Hammer can be, especially for someone starting out. Makes me angry.
I figured I was doing the right thing but some small detail I was overlooking, like not addressing the $basetexture or not putting the files in the right place.
And I did consider it was some problem on the model folders side but because GCFScape or VTFedit couldn't open those files for me to check I figured "well, it can't be that then, that would just over-complicate things."

But, apparently it is that so. And my only fault is believing it be as straight-forward as it is with retexturing custom models.

And yeah. Would like help. I do have other programs like Blender if that is used in model compiling.
 

Tumby

aa
May 12, 2013
1,087
1,196
Model de- and re-compiling only requires notepad and software made by valve. Said software is difficult to use, so the community made stuff to make it easier. So, please go ahead and download "Crowbar": http://steamcommunity.com/gid/103582791434761767
Here's what the process basically looks like:
  1. Extract .mdl and all the other files with their weird file extensions to the same folder. This can be anywhere, even your desktop.
  2. Drag the .mdl into crowbar and decompile.
  3. Edit the .qc file that has been generated. different name, model path, material path, and skin
  4. Drag the .qc file into crowbar and compile.
If you need further instructions, I would like to do this in a chat (steam, discord) instead of the forums.
 

Mystic Monkey

L5: Dapper Member
Jan 24, 2011
224
12
I'd say I made a bit of process than yesturday. They're no longer default textures but instead purple/black missing textures. I've yet to figure out how to fix this but still kind of glad how far I got.

Problem is I'm sure I'm doing it right but still not coming through.
In my Team Fortress 2\tf\models\Mystic_Monkey thats where the .mdl, .vtx and .vvd files are. The .qc, .smd and _anim folders are in the decompile folder.
bannerflag.qc said:
// Created by Crowbar 0.36.0.0

$ModelName "mystic_monkey\bannerFlag.mdl"

$BodyGroup "body"
{
studio "bannerflag_reference.smd"
}

$SurfaceProp "default"

$Contents "solid"

$MaxEyeDeflection 90

$CDMaterials "models\mystic_monkey"

$texturegroup skinfamilies
{
{ "bannerflag_sonic" }
{ "bannerflag_egg" }
}

$CBox 0 0 0 0 0 0

$BBox 0 -66.758 -83.23 39.767 60.616 149.7


$Sequence "ref" {
"bannerflag_anims\ref.smd"
fadein 0.2
fadeout 0.2
fps 30
loop
}

In my Team Fortress 2\tf\materials\models\Mystic_Monkey folder:
bannerflag_sonic.vtf & bannerflag_egg.vtf said:
"VertexLitGeneric"
{
"$basetexture" "models/mystic_monkey/bannerflag"
"$bumpmap" "models/mystic_monkey/bannerFlag_C_normal"

"$nocull" 1

}

I also made sure the _reference.smd files had their triangles named for my models.

Heres a picture: http://www.tiikoni.com/tis/view/?id=a2a8e64
It appears that the model has found it's textures but not sure what to do with it.

But if it's best to help me over Steam than here, my account is http://steamcommunity.com/profiles/76561198034988670
 

Tumby

aa
May 12, 2013
1,087
1,196
Well you seem to have figured most things out yourself already. The only problem here is that the model can't find the material that is specified within the SMD, aka the original name of the material. To fix this, you need to use $renamematerial. I have never used that parameter myself, and the VDC says that it works weirdly with $texturegroup. There's also some excess garbage from decompiling, so this is how I would make the QC:

Code:
$ModelName "mystic_monkey\bannerFlag.mdl"
$Body "body" "bannerflag_reference.smd"

$SurfaceProp "default"

$CDMaterials "models\mystic_monkey"

$texturegroup skinfamilies
{
{ "bannerflag_sonic" "[original material name]" }
{ "bannerflag_egg" "bannerflag_egg" }
}

$renamematerial "[original material name]" "bannerflag_sonic"

$Sequence "ref" "bannerflag_anims\ref.smd"
 

Tumby

aa
May 12, 2013
1,087
1,196
Sorry for double posting, but I noticed that you are specifieing a normalmap in your material. I'm asuming that you are simply copying the original model's normalmap. If that is the case, you do not need to ACTUALLY make a copy of it. Simple reference the original normalmap. Materials and their textures do not need to be in the same folder!
Most people don't seem to realize this, considering the game is stuffed with countless examples of the same texture existing up to 10 times instead of ever being reused.
 

Mystic Monkey

L5: Dapper Member
Jan 24, 2011
224
12
Well you seem to have figured most things out yourself already. The only problem here is that the model can't find the material that is specified within the SMD, aka the original name of the material. To fix this, you need to use $renamematerial. I have never used that parameter myself, and the VDC says that it works weirdly with $texturegroup. There's also some excess garbage from decompiling, so this is how I would make the QC:

Code:
$ModelName "mystic_monkey\bannerFlag.mdl"
$Body "body" "bannerflag_reference.smd"

$SurfaceProp "default"

$CDMaterials "models\mystic_monkey"

$texturegroup skinfamilies
{
{ "bannerflag_sonic" "[original material name]" }
{ "bannerflag_egg" "bannerflag_egg" }
}

$renamematerial "[original material name]" "bannerflag_sonic"

$Sequence "ref" "bannerflag_anims\ref.smd"
Do you mean the bannerflag_reference.smd file? Because I've already readdressed the "triangles" for my model.

Or shouldn't I?

It still ending up checkered, but I am starting to see the logic in the coding. May require me to recheck my .vtf files to make sure.

Sorry for double posting, but I noticed that you are specifieing a normalmap in your material. I'm asuming that you are simply copying the original model's normalmap. If that is the case, you do not need to ACTUALLY make a copy of it. Simple reference the original normalmap. Materials and their textures do not need to be in the same folder!
Most people don't seem to realize this, considering the game is stuffed with countless examples of the same texture existing up to 10 times instead of ever being reused.
You mean models/props_medieval/pendant_flag/bannerFlag_C_normal instead of models/mystic_monkey/bannerFlag_C_normal? Yeah, that would make much more sense now that I think about it.

=== Material and Texture Info ===

Material Folders ($CDMaterials lines in QC file -- folders where VMT files should be, relative to game's "materials" folder):
"models\mystic_monkey\"

Material File Names (file names in mesh SMD files):
(Total used: 4)
"models\mystic_monkey\bannerflag"
"bannerflag_sonic"
"bannerflag_sonic"
"bannerflag_egg"

I think I'm starting to see the error, just yet to figure out how to change it right.
 
Last edited:

Mystic Monkey

L5: Dapper Member
Jan 24, 2011
224
12
The models are still not recognising the textures, but this is what I worked out so far:
$renamematerial "[original material name]" "bannerflag_sonic" doesn't help because I've already changed the _reference.smd files to respond to the new materials. In doing so it was confusing it a bit with it believing there was a "bannerflag_sonic_sonic" material. The compiler believes there are three.

From my texture files I deleted the TF2 default bannerflag files incase that was causing the confusion but it still seems a bit confused. (The originals are still in my addon folder so I can easily recover copies.)

O maybe I do need $renamematerial "bannerflag_c" "bannerflag_sonic" and rename the _reference triangles bannerflag_c as that was the original default TF2 .vtf it was catered for?

I feel like the cause is some minor overlooked detail.
 

Tumby

aa
May 12, 2013
1,087
1,196
All this renaming stuff seems so weird that I would just do something I know for sure works: Import into Blender, change material name in there, export again. This also gives you the oppotunity to fix any smoothing errors from decompiling.
I have now added you on Steam. I would be ready to do all of this for you as it's just getting increasingly complicated for something this simple.