Custom Texture Troubles

  • If you're asking a question make sure to set the thread type to be a question!

TURBOTURTLE5K

L1: Registered
Nov 4, 2017
12
2
Hi. I've been trying to import some custom textures into my map, and I can't seem to get it right. I'm honestly unsure what the problem is, but I feel like I'm just accidentally skipping over something simple.

Anyways, I've placed the texture I'm trying to import in my tf2 my_custom_stuff/materials folder and directed the VMT file to it, as I read to do from various tutorials.

aUH4izs.png


However, when I load up hammer, all I see is that nasty pink/black texture that indicates I did something wrong.

tiMV41S.png


I'm convinced that I just have the directory wrong, as the VTF file was created properly (512x512, nothing fancy about it), but I just really don't know. I'm pretty new when it comes to custom textures. Do I maybe have some slashes in the path wrong? I've tried full forward and backslashes but neither worked.
 

Coding Ethan

L2: Junior Member
Oct 12, 2014
93
109
Try changing the $basetexture property to just "shubtbh".
If you had a folder under materials/, you would put "my_folder/shubtbh"
 
Last edited:

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Yeah never use whole paths for stuff like that, because once you distribute the map, other people aren't necessarily going to have their Steam folder in the same place.
 

TURBOTURTLE5K

L1: Registered
Nov 4, 2017
12
2
Thanks for the responses! I successfully changed the directory and was able to get the thumbnail to show up, but now the texture in hammer is appearing completely white. I couldn't find anything helpful with a few google searches.

6uXUaL3.png

uF9wk9b.png


I don't have any flags checked for the VTF file; all I did was import an already 512x512 image and save it as a VTF. What am I missing?
 
Mar 23, 2013
1,013
347
You didnt follow the advices though :p
The $basetexture path does not includethe root/materials folder or anything before it and ends with the name of the vtf it supposed to use. So use:

$basetexture "shubtbh"

There is no path as the path starts in the material folder but you didnt add any folder in there so there is no folder to specify. So now you just tell the vmt which vtf to use and that is shubtbh
 
Last edited:

TURBOTURTLE5K

L1: Registered
Nov 4, 2017
12
2
OHHHHHHHhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh! Okay, that worked. I didn't know both $basetexture and the filename were required. Should help with my custom sound probs too. Thanks a ton for the responses!

Edit: Seems like I'm having one last problem. My textures are appearing fine in Hammer and seemingly rendering fine, but in game they are... um...

1O4Zmf6.png


A little small. They should be 512x512, and right now they're like a 10th of that.

I did get this error:

"
KeyValues Error: RecursiveLoadFromBuffer: got empty keyname in file materials/shubtbh.vmt
LightmappedGeneric,
KeyValues Error: LoadFromBuffer: missing { in file materials/shubtbh.vmt
(*LightmappedGeneric*),

"

Everything else ran fine. Where did I goof this time?
 
Last edited:

henke37

aa
Sep 23, 2011
2,075
515
There is a parsing error for the material file. Show us the actual code of the file. Do note that the forum software we use here does have a tag for displaying code chunks. Please use that tag.
 

TURBOTURTLE5K

L1: Registered
Nov 4, 2017
12
2
Why are you using notepad for editing VMT files?

Use VTFEdit

I even see you have it installed.

I do use VTFEdit, though. Notepad was just used for editing the path; I read to just use that instead for fixing my auto-generated VMT file, since it didn't specify my D drive in the path, which was causing probs.

There is a parsing error for the material file. Show us the actual code of the file. Do note that the forum software we use here does have a tag for displaying code chunks. Please use that tag.

I'm not sure what you mean by the code of the file. I'm extremely new to all this.

Do you mean one of these?


Code:
"LightmappedGeneric"
{
    "$basetexture "shubtbh"" "D:/Program Files (x86)/Steam/steamapps/common/Team Fortress 2/tf/custom/my_custom_stuff/materials"
}
VdhEZ48.png


Apologies again for the cluelessness. That's why I'm here.
 

henke37

aa
Sep 23, 2011
2,075
515
You have two values for the same key in the file. And you only want the first one. The reported error is about the mismatched quotes.
 

TURBOTURTLE5K

L1: Registered
Nov 4, 2017
12
2
Took a bit of fiddling but I figured out what you meant. The texture appears properly in game now. Thank you!



For anyone as clueless as me w/ a similar prob & looking at this in the future:

I had a path like this
Code:
"LightmappedGeneric"
{
"$basetexture "shubtbh" "D:/Program Files (x86)/Steam/steamapps/common/Team Fortress 2/tf/custom/my_custom_stuff/materials"
}

But I only needed this
Code:
"LightmappedGeneric"
{
    "$basetexture" "shubtbh"
}

That's the end of my questions, then. Thanks a bunch for the help, everyone.