Overriding TF2 content with custom one

Discussion in 'Mapping Questions & Discussion' started by nayðef, Feb 7, 2018.

  1. nayðef

    nayðef L1: Registered

    Messages:
    10
    Positive Ratings:
    0
    Hello everyone
    I have a problem overriding TF2 content with custom one. What I'm trying to to is to replace the default computer models in TF2 with custom one by packing them in the map using VIDE. The custom content is meant to be used as mod for TF2 client and it mimics TF2 folder structure. Ingame when I join the map everything works fine, but when join a map without overriden content, messages start to appear in the console about bad model integrity and vice versa. What to do? Probably rename the custom content folders and vmt files?
     
  2. henke37

    aa henke37

    Messages:
    1,910
    Positive Ratings:
    446
    What files exactly?
     
  3. nayðef

    nayðef L1: Registered

    Messages:
    10
    Positive Ratings:
    0
    Models, materials. Basically, they already exist in the game, but want to override then
     
  4. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    757
    Positive Ratings:
    516
    Why do you want to override them? Can't you just make custom models with an unused name and add those to your map? Why do you need to specifically override existing models?
     
  5. nayðef

    nayðef L1: Registered

    Messages:
    10
    Positive Ratings:
    0
    Yea, can do that but not sure which files to modify and how in order to prevent black-purple texture.
     
  6. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,219
    Are you using pre-made models that were designed to be client-side mods? Is that why they share filenames and paths with stock models?
     
  7. nayðef

    nayðef L1: Registered

    Messages:
    10
    Positive Ratings:
    0
    Yes. Actually I gave a link in the OP, but got unnoticed. The mod is client-side
     
  8. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,219
    It looks like these models ship with a buttload of modified materials and textures, so this is not going to be an easy task should you choose to undertake it. Step one is deciding where you want the custom materials to actually go and what they should be called. You're going to need to remember this.

    Then you need to decompile all the props; Crowbar is your friend here. Crowbar will create two important files for each model: a QC file and an SMD file. Both are plaintext formats you can easily pull up in Notepad and mess with. The SMD is the raw model data—the coordinates of each vertex and what material to render on each face. So if you're renaming your materials, you can do a find-replace in this file. The QC contains all kinds of metadata like whether the prop is transparent, what type of stuff it's made of (metal/wood/glass/etc), and most importantly where the material files are located (the line labeled $cdmaterials). So if you're moving your materials to a new folder, you'll want to edit that line. Also, if these props have multiple skins, you'll find that under $TextureGroup—which lists the name of the default skin (as specified in the SMD) followed by the alternate skins. It's pretty straightforward once you know what to look for.

    Finally, you'll have to recompile your models, also using Crowbar. Bear in mind that decompiling and recompiling has traditionally caused the prop to rotate counterclockwise 90 degrees. I don't remember if Crowbar is designed to compensate for this or not.
     
    • Thanks Thanks x 1
  9. nayðef

    nayðef L1: Registered

    Messages:
    10
    Positive Ratings:
    0
    Oh, didn't know it was so complex task. Anyway, thanks for help. I'm going to do all this conversion sometime in the future