Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Decompiling Source Models - A Tutorial for Source Engine

Decompiling Source Models Learn how to decompile Source models.
Table of Contents 1. Introduction. In this tutorial you'll learn how to decompile models for games such as Counter-Strike: Source and Team Fortress 2. Though this may come easy to some, I've seen a few threads asking how to do this, so I figured I'd make a tutorial for it. 2. Programs Needed. To make any of this possible, you'll need a couple of programs;
   MDLDecompiler. This is used to actually decompile the weapon/model of your choice.
   GUIStudioMDL 2.2. This will be used to re-compile the model after you've made your changes.
   GCFScape 1.6.7. This will be used to access the .gcf files to gather your needed files.
Note:You'll find that the MDLDecompiler is a single executable (.exe) file. You first need to install the Source SDK if it's not already installed. If it is installed, navigate to your steamapps\accountnamehere\sourcesdk\bin\ep1\bin folder, and drop the .exe file from the MDLDecompiler folder in there.
3. Decompiling. After you've downloaded the needed programs & placed them where they should be, you're now ready to begin. For the sake of this being a tutorial, I'm just going to use the default models.
    i. Counter-Strike: Source. Let's begin by decompiling the default Counter-Strike: Source M4A1. We start off by loading GCFScape. You'll be greeted with a screen that looks like this:

(Click to enlarge)
Start by going to File > Open, navigate to your steamapps/counter-strike source/cstrike folder and find cstrike\_pak\_dir.vpk. Click it, and then click Open (or double click it, either way works.) In this VPK file, you'll find all the default models, materials, maps, etc for the game. Within the folder browser in the program, expand root > models > weapons. Find the files for the weapon you want to decompile. For this tutorial, I'll be doing the M4A1 so, I find all the files I'd need which would be; v\_rif\_m4a1.dx80.vtx, v\_rif\_m4a1.dx90.vtx, v\_rif\_m4a1.mdl, v\_rif\_m4a1.sw.vtx, and v\_rif\_m4a1.vvd. To make this easier for you, create two folders on your Desktop. One being named "in", and the other being named "out". Select all the files you'll need, and drag them into your "in" folder you've just created. You can then close GCFScape. Browse to your sourcesdk\bin\ep1\bin folder, and load mdldecompiler.exe. You should then see this pop up on your screen;
Check the little boxes next to the first two options, and un-check the last box if it is already checked. Click the "..." button next to "Choose Model File", browse to your "in" folder, and select the .mdl file you've extracted earlier from the .GCF file. Now, click the "..." button next to "Choose Output Directory", browse to your "out" folder, and click "Select" on the dialog that comes up, and now, click the "Extract" button. The first message that pop's up should say that it loaded the file. Click OK, and then another box should come up say that it completed dumping the model. If you got the second box successfully, and no error, congratulations, you've just decompiled a model. If you go into the folder you've selected for the output directory, you should see a bunch of files. Some .SMD files, and a .QC file. What you do from here is entirely up to you & your imagination.     ii. Team Fortress 2. As you've just learned how to decompile a Counter-Strike: Source model, you can apply this to decompiling Team Fortress 2 models, but!, there is some issues with the current version of the decompiler & Team Fortress 2, so use this instead. (NOTE: The model files for Team Fortress 2 are in common/team fortress 2/tf/tf2\_misc\_dir.vpk and textures in tf2\_textures\_dir.vpk). 4\. Outro. Well, that's the end. I hope if you didn't know how to decompile models, you do now. If you have any questions, or find a typo in here, or anything else, please feel free to ask/let me know. I'll try to help you the best I possibly could. Also, I may edit this to include compiling models again if it's requested (not putting animations on, just editing the .qc & using GUIStudioMDL.). Thanks for reading. :)
1-10 of 20
1
Pages
  • 1
  • 2
Go to page:
  • neymarjrr avatar
    neymarjrr Joined 2y ago
    Offline
    199 points Ranked 71,708th
    1y
    I decompiled the model. (m4a1) then I found the qc file. and then i opened the qc file in the GU─░StduioMdl 2.2,

    but what should I do next? i can't edit anything...
    Bananite
    URL to post:
  • PopNotes avatar
    PopNotes Joined 8y ago
    Offline
    1,801 points Ranked 22,911th
    8y
    Alright, so I extracted the five p228 model files from CS:S, loaded the .mdl up into MDLDecompile (which was in SteamApps/popnotes/sourcesdk/bin/ep1/bin), selected my output, hit extract, it said model loaded but then stopped working after I pressed okay. MDLDecompile hasn't worked for me before either, what am I doing wrong?
    Level 52 Musical Swagifier avatar
    Mantra
    Level 52 Musical Swagifier
    URL to post:
  • dewanbose avatar
    dewanbose Joined 8y ago
    Offline
    112 points Ranked 90,792nd
    8y
    hay... post is awesome.... But can U make models of **battlefield 3** (as for each classes of **day of defeat source**)? & I need The **models to be high textured**...
    Bananite
    URL to post:
  • zch avatar
    zch Joined 9y ago
    Offline
    9y
    Hi. I tried to find **team fortress 2 content.gcf** but i can't. Does anyone know where they are now models of caps (after update may'13)?
    Bananite
    URL to post:
  • project_blackout avatar
    project_blackout Joined 9y ago
    Offline
    956 points Ranked 44,611th
    9y
    Hey, what i need J Model Viewer, when i decompiler MDL source?
    - I LOVE CHEAT - avatar
    Mantra
    - I LOVE CHEAT -
    URL to post:
  • gamer6996 avatar
    gamer6996 Joined 10y ago
    Offline
    3,273 points Ranked 3,515th
    10y
    Dude , when I Import the Idle.smd , Why I only see the Skeleton and I don't see any gun model ???
    Bananite
    URL to post:
  • Estevoo avatar
    Estevoo Joined 14y ago
    Offline
    6,609 points Ranked 1,310th
    13 medals 1 legendary 1 rare
    • 10 years a member Medal icon
    • 6 years a member Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    • One month a member Medal icon
    10y
    Why if a characters animation was decompiled, just one of the legs works?
    Walker bait
    URL to post:
  • Llezer avatar
    Llezer Joined 11y ago
    Offline
    674 points Ranked 48,154th
    10y
    But where can I find the TF2 .mdl files?
    NO HUMAN avatar
    Mantra
    NO HUMAN
    URL to post:
  • galbar avatar
    galbar Joined 12y ago
    Offline
    12y
    Hello and thanks for this tuto !! :) For the re-compling with Guistudio it's easy ???
    Bananite
    URL to post:
  • Nuubba avatar
    Nuubba Joined 13y ago
    Offline
    12y
    Posted by RomZ Do you have a tutorial in doing it 4 non steam?
    its simple. same but you need source sdk files. and i think they are not downloadable to nonsteam.
    Guy Who Like Bloody Weapons!
    URL to post: