OPSkins - Buy & Sell Skins Team Fortress 2 Icon
Team Fortress 2

Recompiling TF2 Models

Greetings! We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending modderfreak points.
  • Post: Give modderfreak your thoughts on this Tutorial.
  • Vote: Help modderfreak win the Monthly Awards.
  • Rate: Give this Tutorial a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Tutorial.
  • Watch: Get notified when this Tutorial is updated.
Mascot

Interested?

Join GameBanana

Already a Bananite? Login

Recompiling TF2 Models

Recompile TeamFortress2 playerview models, using a trick to fix the broken animations.

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.

    Comments

    • Anonymous
      Report post
      6 years ago:
      Do you think you could put some download links in because I not sure I'm downloading the right things!
    • Ian avatar
      Ian Offline
      Member Joined 7 years ago
      Report post
      7 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 avatar
      Klawneed Offline
      Member Joined 8 years ago
      7,979 points Ranked 498th
      Report post
      7 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?
      I still have an uPic avatar
      Mantra
      I still have an uPic
    • modderfreak avatar
      Member Joined 11 years ago
      232,419 points Ranked 13th
      1 medal 0 legendary, 0 rare
      • Received thanks 5 times Medal icon
      Report post
      7 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.
      Respect is everything. avatar
      Mantra
      Respect is everything.
    • Klawneed avatar
      Klawneed Offline
      Member Joined 8 years ago
      7,979 points Ranked 498th
      Report post
      7 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.
      I still have an uPic avatar
      Mantra
      I still have an uPic
    • Tex-DstZ avatar
      Tex-DstZ Offline
      Member Joined 9 years ago
      1,239 points Ranked 3401st
      Report post
      7 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 avatar
      Member Joined 11 years ago
      232,419 points Ranked 13th
      1 medal 0 legendary, 0 rare
      • Received thanks 5 times Medal icon
      Report post
      7 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).
      Respect is everything. avatar
      Mantra
      Respect is everything.
    • Tex-DstZ avatar
      Tex-DstZ Offline
      Member Joined 9 years ago
      1,239 points Ranked 3401st
      Report post
      7 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 avatar
      mrkit4423 Offline
      Member Joined 8 years ago
      6,566 points Ranked 601st
      Report post
      7 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 avatar
      .eXe Offline
      Member Joined 8 years ago
      Report post
      8 years ago:
      Thanks a lot !I finally made it !This is the most helpful tutorial i've ever seen ! THANKS ! 10/10

      10/10

    Share

    Shareable Image:
    Share banner
    HTML embed code:
    BB embed code:
    Markdown embed code:

    More embeddable images

    Bookmark and Share

    Credits

    Key Authors
    modderfreak
    Unknown

    Studio

    Submitter

    modderfreak avatar
    Member Joined 11 years ago
    232,419 points Ranked 13th
    1 medal 0 legendary, 0 rare
    • Received thanks 5 times Medal icon

    modderfreak
    Creator
    Send a Private Message to the submitter

    Game

    Category

    Details

    Genre
    Compiling
    Difficulty Level
    Intermediate

    Stats

    Posts
    18
    Views
    22,052
    Date Added
    8 years ago
    Nov 8 2008 @ 10:01pm UTC
    Date Modified
    3 years ago
    Jul 13 2013 @ 10:40pm UTC

    Rating

    10
    Votes
    2

    Ratings Breakdown

    CriterionAvg.VotesRange
    Overall 10 2 10 to 10

    WiPs by modderfreak