Home Technical Talk

Importing custom props into hammer/source

polycounter lvl 6
Offline / Send Message
zakhar2 polycounter lvl 6
I recently decided to try making a map for counter strike (lol) and im having serious issues getting any custom props to show up properly in the engine. The model compiles, and i can get it and the collision in game, but the texture doesnt work at all (i get the debug texture instead of the one i specified).

my qc file lookes like so:
$modelname "rend.mdl"
$cdmaterials "models"
$scale 1
$surfaceprop "default"
$staticprop
$body "Body" "rend"
$sequence idle "rend_idle" loop fps 1
$collisionmodel "rend_phy.smd"
{
$mass 1
$concave
}
and my vmt file looks like this:
"VertexlitGeneric"
{
"$basetexture" "models/tv_mat"
"$bumpmap" "models/tv_norm"
"$surfaceprop" "Computer"
"$translucent" 1
"model" 1
}
If anyone knows whats up, please help!

Replies

  • cman2k
    Options
    Offline / Send Message
    cman2k polycounter lvl 17
    "The texture doesn't work at all"....? This is a vague description of your problem. What exactly is wrong?
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Describe what is happing, is the the engine find the vmt fine but not finding the texture or is it not finding the vmt at all?

    do you got the material slot properly named in your model before you exported?

    some info is needed if you want help.
  • Zipfinator
    Options
    Offline / Send Message
    Zipfinator polycounter lvl 9
    As Passerby said, it sounds like your material applied to the model before you export to .smd isn't named the same as your vmt.
  • zakhar2
    Options
    Offline / Send Message
    zakhar2 polycounter lvl 6
    Gah, sorry for not being specific enough. Well, when i open my model in the model viewer, it cant find the vmt that i specified. what's the proper way of naming a material before export? Im using the prall exporter for maya by the way.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    you name the material, the same name you gave to the vmt minus the extension.
  • Mark Dygert
    Options
    Offline / Send Message
    WALLWORM MODELING TOOLS!!! seriously I wouldn't bother doing it manually. It exports meshes and simple materials easily and quickly. I don't mean to say there isn't value in bashing your head on the keyboard and learning the whole delicate source dance routine but seriously Wallworm Modeling Tools I wouldn't touch source without it.

    A word of warning, it does a few things I don't like:
    Creates new layers and moves models around.
    Places spline text next to your model.
    If you've turned on rendering in any spline recently it will turn it on for the next set of spline text it makes.
    The UI is a bit of a mess and could be straightened out and compacted.
    It can be a bit of a pain to get the paths hooked up correctly.

    But all of that is overshadowed by how easy it makes things once you get it working.
  • zakhar2
    Options
    Offline / Send Message
    zakhar2 polycounter lvl 6
    @passerby: sorry, that didnt seem to help. I still get the same error.

    @mark Dygert: That would be amazingly useful except im using maya. :/ sorry.
  • Mark Dygert
    Options
    Offline / Send Message
    fuckin maya... =P
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    your using pralls export script right?

    iv mostly been using blender and smd-tools to do all my source exports, but just give me a sec and i will try out a quick thing for source and see what works.

    after making and assigning your material try to add a texture that has the same name as your vmt to the diffuse/color channel of your material.
  • zakhar2
    Options
    Offline / Send Message
    zakhar2 polycounter lvl 6
    Ive already had it that way... :/

    One thing i noticed was that when i decompiled other models, there is a line in the reference .smd that points to a file in the materials folder. However, the same line in my smd points to debug/debugempty, like so:
    version 1
    nodes
    000 "polySurface27" -1
    001 "pCube1" -1
    end
    skeleton
    time 0
    0 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
    1 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
    end
    triangles
    debug/debugempty
    0 00000000 -16.45489 -28.33839 0.00000 -0.44733 0.89436 0.30585 0.61144 1 0 1
    0 00000000 -16.45256 -31.88485 -5e-005 -0.99907 -0.04301 0.30585 0.59910 1 0 1
    0 14.61351 -16.45489 -28.33839 -1e-005 -0.70726 0.70695 0.35692 0.61144 1 0 1
    debug/debugempty

    0 14.61351 -16.45489 -28.33839 -1e-005 -0.70726 0.70695 0.35692 0.61144 1 0 1
    0 00000000 -16.45256 -31.88485 -5e-005 -0.99907 -0.04301 0.30585 0.59910 1 0 1
    0 14.61351 -16.45375 -31.88491 -4e-005 -0.99793 -0.06419 0.35702 0.59910 1 0 1
    ....etc...
    I think its supposed to be different, but i have no idea what to change it to.
  • cman2k
    Options
    Offline / Send Message
    cman2k polycounter lvl 17
    I'm not familiar with Maya but if it's anything like Max.

    -Make sure that you have a texture applied to your object in Maya
    -Make sure that the texture applied has the same filename as the VMT Material
    -Make sure that your Material IDs/Sub-materials/whatever the hell is used to define what material each polygon uses, is setup properly.
    - $cdmaterials "models" ; from your QC seems wrong. try adding the necessary slashes in there, or put your material in a sub-folder of the materials folder and make sure you get the slashes right. The slashes are finicky. Forwards/backwards don't always work, and omitting them can break things.


    SMDs are not required to have material path names embedded into them, only the materials name itself. There may be extra data from valve's internal pipeline, but that is not the standard way that the community compiles things, and it is definitely not what is messing you up.
  • zakhar2
    Options
    Offline / Send Message
    zakhar2 polycounter lvl 6
    Guys, im really thankful for all your help, and i think i finally figured it out. I added a \ to the end of my cdmaterials line and changed the "debug/debugempty" line to the name of my material and everything seems to be working great!
  • Rick_D
    Options
    Offline / Send Message
    Rick_D polycounter lvl 12
    $cdmaterials "models"
    "$basetexture" "models/tv_mat"

    can you see the problem?
  • Mark Dygert
    Options
    Offline / Send Message
    Your final directory would need to be ".../models/models/tv_mat"?
  • Rick_D
    Options
    Offline / Send Message
    Rick_D polycounter lvl 12
    source automatically searches for vtf/vmt files in game/materials. and searches for model files in game/models.

    so when he writes:

    cdmaterials "models"

    source will look for his vmt in: game/materials/models

    but unless he has placed his vmt in "materials/models" and his vtf in "materials/models/tv_mat" then his current setup won't work.

    the basic workflow needsto be like this:

    assign a material to your model, and your collision shapes, this material name is important, it'll be what you need to name your vmt. example: "television"
    set up your qc, and put the folder path you want source to look for your vmt in. example would be: "models/props/tv" - this means source is going to look for this file:
    "c:/program files/steam/steamapps/xXxSniPeR420SapHiRotH/counter-strike/css/materials/models/props/tv/television.vmt"

    your vmt can then point to any vtf it likes, as source is only looking for the vmt in that specific folder.
  • zakhar2
    Options
    Offline / Send Message
    zakhar2 polycounter lvl 6
    Rick_D wrote: »
    $cdmaterials "models"
    "$basetexture" "models/tv_mat"

    can you see the problem?


    Goddammit Im retarded
Sign In or Register to comment.