Broken vending machine

Discussion in 'Mapping Questions & Discussion' started by Mystic Monkey, Apr 14, 2019.

  1. Mystic Monkey

    Mystic Monkey L5: Dapper Member

    Messages:
    211
    Positive Ratings:
    23
    For my map I'm trying to reskin a vending machine I got from GMod.
    Importing things from GMod, texture and all is usually no problem. But when I try to reskin it it's usually hit or miss whenever it'll work or not.

    I'm sure I've done everything right and properly addressed the .qc, .smd and .vmt files...
    Code:
    $ModelName "mystic_monkey\vending_machine\dispenser.mdl"
    
    $StaticProp
    
    $BodyGroup "Body"
    {
        studio "dispenser_reference.smd"
    }
    
    $LOD 100
    {
        replacemodel "dispenser_reference.smd" "dispenser_reference_lod1.smd"
    }
    
    $SurfaceProp "plastic_barrel"
    
    $Contents "solid"
    
    $MaxEyeDeflection 90
    
    $CDMaterials "models\mystic_monkey\vending_machine\"
    
    $TextureGroup "skinfamilies"
    {
        { "chaos_cola" }
        { "chaos_soda" }
    }
    
    $CBox 0 0 0 0 0 0
    
    $BBox -21.661 -26.375 -48.285 21.423 26.334 48.293
    
    
    $Sequence "idle" {
        "dispenser_anims\idle.smd"
        fadein 0.2
        fadeout 0.2
        fps 30
    }
    
    $CollisionModel "dispenser_physics.smd"
    {
        $mass 600
        $inertia 1
        $damping 0
        $rotdamping 0
        $rootbone " "
        $concave
    
    }
    
    $KeyValues
    {
        prop_data
        {
            "base" "Metal.Large"
        }
    }
    
    ...but I don't know why it's not working.
    Untitled.png

    I had the same problem with another object with a custom skin, it too had a broken texture. So I decided to just delete it and re-imported it again and that time around it functioned properly but I did not know what I did right that time.

    Am I missing some small detail I should be doing?
     
  2. Litronom

    Litronom L1: Registered

    Messages:
    12
    Positive Ratings:
    2
    Looks like an issue with the vmt files. Post the content of them.
     
  3. Mystic Monkey

    Mystic Monkey L5: Dapper Member

    Messages:
    211
    Positive Ratings:
    23
    All I did was copy-paste the original vending machine .vtf and .vmt, change the .vtf and re-address the $basetexture in .vmt.
    Code:
    "VertexLitGeneric"
    {
       "$basetexture" "models/mystic_monkey/vending_machine/dispenser"
       "$surfaceprop" "metal"
    
       "$envmap" "env_cubemap"
       "$envmaptint" "[ .5 .5 .5]"
       "$envmapcontrast" "1.1"
       "$envmapsaturation" "[1 1 1]"
    }
    I figured maybe something is broken in the $env- commands and tried it without them, given a non-shiny vending machine would be fine, but thats still broken.

    Just to clarify my models are in:
    E:\Steam\steamapps\common\Team Fortress 2\tf\models\mystic_monkey\vending_machine
    and the required materials are in
    E:\Steam\steamapps\common\Team Fortress 2\tf\materials\models\mystic_monkey\vending_machine

    I'm positive I addressed the .qc and .vmt right.

    *Edit- I tried it with \ instead of /, still doesn't work.
     
    Last edited: Apr 15, 2019
  4. Litronom

    Litronom L1: Registered

    Messages:
    12
    Positive Ratings:
    2
    Try the following:
    -Open your dispenser.vtf with VTFEdit
    -Go to "Tools" -> "Create VMT File"
    -Use "VertexlitGeneric" as the shader and have everything unticked -> Create
    -Save it as "chaos_cola.vmt"
    -Check again in hlmv.exe
    -If it shows up now, add the other parameters to your vmt
     
    • Agree Agree x 1
  5. Mystic Monkey

    Mystic Monkey L5: Dapper Member

    Messages:
    211
    Positive Ratings:
    23
    Thank you. Through that I figured out what I did wrong.

    I thought $basetexture was suppose to be addressed for the model itself when it should be addressing the .vtf file. I normally don't make that mistake but for some reason I overlooked it.
     
    Last edited: Apr 15, 2019
  6. Litronom

    Litronom L1: Registered

    Messages:
    12
    Positive Ratings:
    2
    Alright, at least you got it working now and know what to look for in the future.
     
    • Thanks Thanks x 1
  7. Mystic Monkey

    Mystic Monkey L5: Dapper Member

    Messages:
    211
    Positive Ratings:
    23
    Thanks.
     
    • Like Like x 1