1. Hey there Guest,

    The game servers have moved to semi-dedicated hardware and IPs have changed. Please see front page server widget for up-to-date game server information.

Checkers on my custom model

Discussion in 'Mapping Questions & Discussion' started by Hawk, Dec 5, 2007.

  1. Hawk

    Hawk L7: Fancy Member

    Messages:
    419
    Positive Ratings:
    212
    Hi! I've been able to accomplish a lot thanks to the information on this site. I was wondering if somebody could help me with what I assume is a common and simple problem....

    [​IMG]

    I'll bet this problem looks familiar to somebody...

    I created a custom battleship model for a map I'm making. I first compiled it and placed it in the proper directory. As you can see, it worked because I can put it in my level in Hammer. It's the texture that's the problem.

    I'm not sure why, but Vtex gave me lots of trouble, so I eventually turned to a Photoshop plugin solution as was suggested in another thread. It properly exported my texture. I also created a very simple .VMT file that looks like this:

    Code:
    "LightmappedGeneric"
    {
    	"$basetexture" "battleship"
    	"$translucent" 1
    	"$ignorez" 1
    	"$vertexcolor" 1
    }
    
    I placed both the battleship.vmt and battleship.vtf files in the "team fortress 2/tf/materials" directory. However, the texture doesn't show up in Hammer, the model view, or the game itself. I wasn't clear on where to put the battleship.vmt file, so I copied it into the "tf/models" directory as well (where my battleship model files are). Also, the texture file opens just fine in Photoshop using the plugin.

    Are my files in the wrong places? Or could it be that the 5.5mb texture file is too big? (I admit it's big, but so is the object I'm putting it on!).

    Many thanks to anybody who can help me solve this.
     
  2. spaceweasels

    aa spaceweasels

    Messages:
    219
    Positive Ratings:
    336
    If there are regular material textures, I would remove the $ignorez and $vertexcolor parameters. I might also get rid of the $traslucent parameter and replace it with $surfaceprop.

    Also what VTF formatare you saving them as? I find GRA8888 works well for regular textures, and DXT5 for decals or textures using an alpha channel.
     
  3. Hawk

    Hawk L7: Fancy Member

    Messages:
    419
    Positive Ratings:
    212
    Thanks for the advice on the .VMT changes. I've changed the file, as well as changing it from LightmappedGeneric to VertexLitGeneric (which I heard was better for objects). Also, the VTF's formature is BGRA8888 (I kept things pretty default).

    The object still gives me a checkered texture. I'm just curious because I can't find the answer in any of Valve's online documentation, but where does the .VMT file go? In the materials directory with the texture, or in the models directory with the model? Or even somewhere else?
     
  4. spaceweasels

    aa spaceweasels

    Messages:
    219
    Positive Ratings:
    336
    I put the VMTs in the same folder as my VTF files. In fact, I made a subdirectory called spaceweasels in my materials folder. This is where I put my custom textures (so I can put in a filter called spaceweasels in Hammer to easily find my custom textures).

    This is what one of my VMT looks like:
    Code:
    "LightmappedGeneric"
    {
       "$basetexture" "spaceweasels\Brickwork"
       "$surfaceprop" "concrete"
    }
    One problem I had early in my texture making was adding the VTF extension to the texture file name in my VMT files. This made Hammer look for a file called Brickwork.vtf.vtf which didn't exist.

    Hope that helps.
     
    Last edited: Dec 5, 2007
  5. Snipergen

    Snipergen L13: Stunning Member

    Messages:
    1,053
    Positive Ratings:
    150
    hawk if you have it sorted by the help of other guys it would be great, i have done custom modeling so many times already i can do it blindly so if it still doesnt work i can help you.

    Just remember 1 model = 1 square texture
     
  6. Hawk

    Hawk L7: Fancy Member

    Messages:
    419
    Positive Ratings:
    212
    I've become more and more convinced that I've made some sort of silly mistake somewhere. My texture actually shows up as a usable texture in Hammer, just not connected to the model I want it on. I wonder if there was something I was supposed to do in the compiling phase to connect the texture to the model.

    Spaceweasels - thanks for clarifying where my VMT goes and giving a good examle. Mine looks a lot like that. I've luckily avoided the .vtf.vtf problem.

    Snipergen - Could you do that for me? I would greatly appreciate it. Hopefully seeing what you do will show me what I'm doing wrong. I've got the files here in the .RAR file and sorted like I have them on my hard drive (tf\models and tf\materials).
     
  7. Hawk

    Hawk L7: Fancy Member

    Messages:
    419
    Positive Ratings:
    212
    All right... I've been racking my brain over this thing and looking over all sorts of tutorials, plenty of them being for other source games like Half Life 2. One of them clued me in on a line I didn't have in my model's .QC file for compiling:

    Code:
    $cdmaterials "models/weapons/"
    
    Well, given that information and a little help from the Neil Jedrzejewski's MDL Texture Information tool, I was able to set where the texture should be and in turn know where it was supposed to go.

    It works! I did the engineer dance of joy.

    Thanks for your help, spaceweasels and Snipergen.
     
  8. Snipergen

    Snipergen L13: Stunning Member

    Messages:
    1,053
    Positive Ratings:
    150
    Im sorry i didnt reply fast enough hawk but im happy it works now. Great feeling isnt it? I had it too when it finally worked because all the tuts around are absolute SHIT.

    But once you get it its easy. But still a pain in the ass, i miss an option in hammer like : tools->import->.obj or something :(
     
  9. Hawk

    Hawk L7: Fancy Member

    Messages:
    419
    Positive Ratings:
    212
    No kidding... Valve could seriously stand to take out some of the middle steps in importing a model.

    I'm going to tackle a few more custom models. Maybe when I get this down I can make a TF2-specific tutorial that isn't full of holes.
     
  10. Deadeye2007

    Deadeye2007 L2: Junior Member

    Messages:
    52
    Positive Ratings:
    0
    Hawk,

    I would very much appreciate if you could post a walkthrough of how you got your models to work. I've spent 3 days now trying different things, and it simply will not work for me.

    Any help you could give would be much appreciated.
     
  11. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,920
    Code:
    "LightmappedGeneric"
    
    should be

    Code:
    "VertexlitGeneric"
    
    but i doubt this is the source of you're problems, this usually manifests itself in other ways (like telling you whats wrong)
     
  12. Deadeye2007

    Deadeye2007 L2: Junior Member

    Messages:
    52
    Positive Ratings:
    0
    Still really hung up on compiling models for TF2. Unlike most other tutorials on the net for HL2, the modeling compiling ones don't seem to work for the orange box directory structure.

    Anyone care to post a basic compiling walkthrough for a newbie mapper.
     
  13. Intraman

    Intraman L4: Comfortable Member

    Messages:
    191
    Positive Ratings:
    0
    What you might want to try is reverse engineering one of the valve models. That's how I figured out how to get my skybox texture working.
     
  14. horza

    horza Guest

    Positive Ratings:
    0
    hi all,

    I have this exact pink check problem, but having read through this thread and used the tools mentioned i still have the problem, i even see pink checks when using the texture browser to view my texture.

    I can open my VTF file in photoshop and it's fine (i created it in PS, tried loads of different save options, res 512x512)
    MDLTexureInfo shows my VMT file name is correct (VTF file is the same name in the same folder) and that my paths are correct

    =============
    TEXTURE NAMES
    =============
    Texture 1 - "Hull01DiffuseMap.vmt"

    TEXTURE FOLDER(S)
    =================
    Texture path 1 - "<Mod Folder>\materials\models\horza\parts\"
    =======================

    my vmt is the same as the one spaceweasels posted but with $basetexture set to "models/horza/parts"

    i have tried both "VertexlitGeneric" and "LightmappedGeneric" but still the same pink check.

    regarless of what the mdl is looking for i should be able to see the texture using the texture browser shouldn't I? but all i see is 64x64 pink checker

    any help appreciated, this is doing my head, which hopefully it'll be obvious to one of you :)

    thanks

    Horza
     
  15. Dox

    Dox L8: Fancy Shmancy Member

    Messages:
    588
    Positive Ratings:
    62
    Im having the same problem i think... which is annoying cause i made the model that doesnt work almost the exact same way as one that does.
     
  16. horza

    horza Guest

    Positive Ratings:
    0
  17. horza

    horza Guest

    Positive Ratings:
    0
    VTFedit rules :)
    I used it to create the VMT and i can now see the texture in the hammer brower

    now i have seen the autocreated VMT I have realised what my problem was...
    in the VMT i thought basetexure was just a path so i had

    "$basetexture" "models/horza/Parts"

    What i didn't realise is that the last part is actually the file name with out he VTF extension, so i needed

    "$basetexture" "models/horza/Parts/Hull01DiffuseMap" (Hull01DiffuseMap.vtf being my texture)

    kinda obvious now :p but thought i'd share incase anyone else manages to make the same stupid mistake. Must have missed a line of text while reading up on all this :)

    Cheers

    Horza
     
  18. Dogmeat

    Dogmeat L1: Registered

    Messages:
    10
    Positive Ratings:
    1
    One of them clued me in on a line I didn't have in my model's .QC file for compiling:

    Code:
    $cdmaterials "models/weapons/"
    
    This seems the be the reason mine wont link up either, but what is it refering to? Is that the directory where your vmt/vtf files should be? Heres my QC file.

    Code:
    $modelname anubis_001.mdl
    $body "Body" "anubis_001_ref.smd"
    
    $cdmaterials "models/weapons/"
    $scale 1.0
    $staticprop
    $surfaceprop "rock"
    $upaxis z
    
    $sequence "idle" "anubis_001_ref.smd" fps 15
    $collisionmodel "anubis_001_ref.smd"
    {
    //Mass in kilograms
    $mass 350.0
    $concave
    }
    
    $keyvalues {
    "prop_data" {
    "base" "metal.small"
    }
    }
    
    little frustrating to say the least, i was first trying to export from maya which did not work out, switched to 3dsmax got a little farther can see the model but its got the checkerboard in hammer and invisible in game. My VMT file in VMTedit is just.

    "VertexlitGeneric"
    {
    "$basetexture" "Program Files/Steam/SteamApps/pvtdogmeat/Modeling/Custom/anubis_001/anubis_difuse"
    "$normalmap" "Program Files/Steam/SteamApps/pvtdogmeat/Modeling/Custom/anubis_001/anubis_normal"
    "$surfaceprop" "concrete"
    }


    any thoughts would be great.
    p.s. i heard valve is switching to a .dmx? or something format in studio. anyone else know anything of this?
     
  19. Eradicatus

    Eradicatus L1: Registered

    Messages:
    30
    Positive Ratings:
    7
    You are using absolute paths in your VMT. You need the relative path.
    And the folder must be inside the mod folder you are working in.
    I.E for TF2. You need to have the material files inside ...\steamapps\.\team fortress 2\tf\materials\ or a subfolder of this folder.

    Also, it is important that you have a texture assigned to the model with the same name as the VMT,
    when you export it from the 3d package. Any texture will do, as long as the name is correct.

    I recently found a new DMX exporter/importer in the plugins manager. I have no idea what it is though.
    There were something else there too. I believe it was something about vertex animation export?
     
    Last edited: Oct 11, 2009
  20. Dogmeat

    Dogmeat L1: Registered

    Messages:
    10
    Positive Ratings:
    1
    Thanks for the reply Eradicatus, iv been trying different example QC files and directory paths for over two weeks now, didnt really wan`t to ask somebody till ì absolutely had to. So i re-exported my smd with a material in 3DSmax called anubis_texture, my VMT has the same name. I understood what you said about my VMT and relative paths so it now reads.

    "VertexlitGeneric"
    {
    "$baseTexture" "models\props\anubis_difuse"
    "$normalmap" "models\props\anubis_normal"
    }

    The VTF`s and VMT are located in this directory:
    C:\Program Files\Steam\SteamApps\pvtdogmeat\team fortress 2\tf\materials\models\props


    my QC is now this

    $modelname anubis_001.mdl
    $body "Body" "anubis_001_ref.smd"

    $cdmaterials "models/props/"
    $scale 1.0
    $staticprop
    $surfaceprop "rock"
    $upaxis z

    $sequence "idle" "anubis_001_ref.smd" fps 15
    $collisionmodel "anubis_001_ref.smd"
    {
    //Mass in kilograms
    $mass 350.0
    $concave
    }

    $keyvalues {
    "prop_data" {
    "base" "metal.small"
    }
    }

    and is in this directory with the SMD
    C:\Program Files\Steam\SteamApps\pvtdogmeat\Modeling\Custom\anubis_001

    so what do you think i am doing wrong here. Im pulling my hair out, Iv imported models into Unreal and it was a breeze but this is stumping me.

    Happy Canadian Thanksgiving to everyone at TF2maps.net