Recompiling TF2 Models

This tutorial will cover how to recompile default TeamFortress2 playerview models, using a trick to fix the broken animations.

Required

Programs:

  • A Source Model Decompiler
  • GUI Studio MDL (recompiling)
  • Other:

  • Source-SDK with Half-Life Model Viewer
  • A working, updated installation of TF2
  • Recompiling

    Preparing

    • Locate the original (non-Hexed) .mdl file of the model you want to decompile. For this tutorial, I will recompile the Sniper Rifle. Therefore, I need the v\_sniperrifle\_sniper.mdl file.
    • Rename the .mdl file to anything you want. -We will use this file for the animation sequences, therefore it would be useful if you label it somewhat similar to its original name. -I will call my sniper rifle .mdl v\_sniper.mdl.
    • Save the new .mdl file to your models\weapons\v\_models folder.
    • Next, we need to decompile the default model we want to use. -If you don't know how to decompile TF2 models, have a look at this tutorial.

    .qc Editing

    • Open the mdldecompiler.qc of the freshly decompiled model. You can use Notepad or any similar text editor for this.
    • After the second line, instert a new one linking to the renamed .mdl file we created, using the $includemodel command. In my case, the matching .qc code will look like this:
      $includemodel "weapons\v\_models\v\_sniper.mdl"
    • With the previous step, we adviced the compiler to use the animation sequences of the original .mdl. This way, we don't need to use the broken decompiled animation sequences. Since any animation sequence line in the .qc will override this though, we need to remove them. Refer to screenshot A for an example of what your edited .qc could look like.
    • This step is case-specific: if your .qc has a $texturegroup modifier, it will probably be broken. For this case, the Valve Wiki will help you getting the code proper; basically all '{' need to have spaces after them.

    Compiling

    • Once these steps are done, you are free to modify your reference model, for example replacing the old sniper rifle with a new model.
    • Finally, we need to recompile our model using GUI Studio MDL. -Make sure to use the latest version of this compiling program, otherwise it'll probably not work! Load your .qc, select the Orange Box SDK Version, select TF2 as target game, hit "Compile" and you're done ;) Refer to screenshot B for an example of what your GUI Studio MDL with all settings applied could look like.
    • Now remember to put the freshly compiled files into a new custom folder. Go to your common\team fortress 2\tf\custom folder and make a new folder, inside that goes the models folder, then the weapons folder and so on, just remember to keep the directory structure.

    Oh noes! You're not a Member!

    Want access to cool stuff? As a member you can:

    • Post. Give the submitter your thoughts on this Tutorial.
    • Say Thanks. Show your appreciation by sending the submitter points.
    • Stamp Posts. Let other posters know what you think of their posts.
    • Rate. Give this Tutorial a rating out of 10.
    • Flag. Alert moderators and warn members of a problem with this Tutorial.
    • Vote. Vote the submitter for the Monthly Awards.
    • Subscribe. Get notified when this submitter submits again.

    Interested? Register or Login

    Comments

    • Anonymous
      4 years ago:

      Do you think you could put some download links in because I not sure I'm downloading the right things!

    • Ian's Levels
      • P1: Beggar
        Points: 46
      • A5: Veteran
        Account Age: 5 years
      5 years ago:

      Hey, I'm having an error with my playermodel compiling, could you please help? Thread: http://www.fpsbanana.com/threads/163280?2

      Please add me on MSN if you can, or simply respond the thread.

      Bananite
    • Klawneed's Levels
      • P3: Peasant
        Points: 7,979
      • A5: Veteran
        Account Age: 6 years
      5 years ago:
      Posted by modderfreak
      Posted by Klawneed If i compile say, the smg for the needlegun, will it have sniper hands? Or is it fully working? Also, is this tut only for custom models or can i use Valve default models? Thanks in advance.
      No, you'll have to exchange the hand models manually. It does not make a difference if you're recompiling a default or custom model.

      How do i do that?

      User Title
      I still have an uPic
    • modderfreak's Levels
      • P6: Merchant
        Points: 232,109
      • E1: Helper
        EF: 17
      • A6: Elder
        Account Age: 9 years
      5 years ago:
      Posted by Klawneed If i compile say, the smg for the needlegun, will it have sniper hands? Or is it fully working? Also, is this tut only for custom models or can i use Valve default models? Thanks in advance.

      No, you'll have to exchange the hand models manually. It does not make a difference if you're recompiling a default or custom model.

      User Title
      Respect is everything.
    • Klawneed's Levels
      • P3: Peasant
        Points: 7,979
      • A5: Veteran
        Account Age: 6 years
      5 years ago:

      If i compile say, the smg for the needlegun, will it have sniper hands? Or is it fully working? Also, is this tut only for custom models or can i use Valve default models? Thanks in advance.

      User Title
      I still have an uPic
    • Tex-DstZ's Levels
      • P2: Drudge
        Points: 1,194
      • A6: Elder
        Account Age: 7 years
      5 years ago:

      Ok i seem to have found the source of the error.....

      i had it decompiling from and to the desktop.

      i moved the folder to C:\ and it worked perfectly...

      it seems the directory was too long...... i dunno hope that helps somebody out there

      Bananite
    • modderfreak's Levels
      • P6: Merchant
        Points: 232,109
      • E1: Helper
        EF: 17
      • A6: Elder
        Account Age: 9 years
      5 years ago:

      I guess your decompiler crashed? If so, simply try it again and again until it works (actually that's what I'm always doing).

      User Title
      Respect is everything.
    • Tex-DstZ's Levels
      • P2: Drudge
        Points: 1,194
      • A6: Elder
        Account Age: 7 years
      5 years ago:

      I have everything ready for recompile.. except.. my qc file was generated incorrectly. it is completly blank (which is no use to me at all) any ideas on how to fix?

      Bananite
    • mrkit4423's Levels
      • P2: Drudge
        Points: 6,531
      • E1: Helper
        EF: 1
      • A5: Veteran
        Account Age: 6 years
      5 years ago:

      Nice tutorial, but can anyone try to decompile any tf2 view weapon and see if u get the qc file please? i tried decompile 7 view weapons, all of them missed the qc file.

      idk wts wrong

      Bananite
    • .eXe's Levels
      • P1: Beggar
        Points: 16
      • A6: Elder
        Account Age: 6 years
      6 years ago:

      Thanks a lot !I finally made it !This is the most helpful tutorial i've ever seen ! THANKS ! 10/10

    Credits

    Key Authors
    modderfreak
    Unknown

    Studio

    Studio
    Avenger Corp.™

    Submitter

    modderfreak's Levels
    • P6: Merchant
      Points: 232,109
    • E1: Helper
      EF: 17
    • A6: Elder
      Account Age: 9 years
    modderfreak (Creator/Co-creator)

    Rating

    10.0/10
    Based off 2 rating(s)

    Additional Info

    Genre
    Compiling
    Difficulty Level
    Intermediate

    Stats

    Post Count
    18
    ViewCount
    17,626
    Date Added
    6 years ago
    Date Modified
    1 year ago

    Share

    Code to use:

    More embeddable images

    Bookmark and Share