Custom Texture Troubles

Discussion in 'Mapping Questions & Discussion' started by TURBOTURTLE5K, Nov 4, 2017.

  1. TURBOTURTLE5K

    TURBOTURTLE5K L1: Registered

    Messages:
    9
    Positive Ratings:
    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.

    [​IMG]

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

    [​IMG]

    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.
     
  2. Coding Ethan

    Coding Ethan L2: Junior Member

    Messages:
    81
    Positive Ratings:
    70
    Try changing the $basetexture property to just "shubtbh".
    If you had a folder under materials/, you would put "my_folder/shubtbh"
     
    • Thanks Thanks x 1
    Last edited: Nov 4, 2017
  3. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,219
    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.
     
    • Thanks Thanks x 1
  4. TURBOTURTLE5K

    TURBOTURTLE5K L1: Registered

    Messages:
    9
    Positive Ratings:
    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.

    [​IMG]
    [​IMG]

    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?
     
  5. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    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
     
    • Thanks Thanks x 1
    Last edited: Nov 4, 2017
  6. TURBOTURTLE5K

    TURBOTURTLE5K L1: Registered

    Messages:
    9
    Positive Ratings:
    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...

    [​IMG]

    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: Nov 4, 2017
  7. henke37

    aa henke37

    Messages:
    1,927
    Positive Ratings:
    454
    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.
     
  8. AsG_Alligator

    aa AsG_Alligator trigger_hiss

    Messages:
    433
    Positive Ratings:
    941
    Why are you using notepad for editing VMT files?

    Use VTFEdit

    I even see you have it installed.
     
  9. TURBOTURTLE5K

    TURBOTURTLE5K L1: Registered

    Messages:
    9
    Positive Ratings:
    2
    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.

    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"
    }
    
    [​IMG]

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

    aa henke37

    Messages:
    1,927
    Positive Ratings:
    454
    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.
     
    • Thanks Thanks x 1
  11. TURBOTURTLE5K

    TURBOTURTLE5K L1: Registered

    Messages:
    9
    Positive Ratings:
    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.