Garry's Mod

Garry's Mod

598 ratings
How to Create and Port Models into Garrysmod
By The Devils Own
All porters had to start somewhere. However there were no basic tutorials or guides that went in depth to help those that are wanting to start get up on their feet. Like me, I had to learn by myself and my first port were never the best. But as the years went by and the more I ported and practice, I can now port as if it is as simple as coding a swep.

Though, there are not a lot of guides out there to help those new beginners on starting it. So today, I am here to show you on how you can port your own models, and the ways that I do it, and some tips and tricks on when it comes to porting. This guide is as in-depth as it can be, and requires as much attention as possible, but for those that want to put their own model they created on garrysmod, or take a model from another game and put it in Garrysmod, stay tune for this and follow my guide.
2
   
Award
Favorite
Favorited
Unfavorite
Getting the Tools.
In the beginning of any porting, you need to have the tools required to do it all. So what I am prepared to do is upload my personal porting station for all those that are wanting to port. This pack concludes all the certain things you need up to date on porting, so I highly recommend you downloading it. It includes these such as
Gmad Extractor
GUIStudio
MDLDecompiler
Milshape 3d 1.8.5 (Full Version no charge)
UPK Unpacker
VPK Extractor
VTFEdit
Workshop Uploader

Here is the link to include all of them: https://mega.nz/#!PJEhWaqB!v_feGYkpLicIvPsPrKhTMOutd8_mapRZ82YMwX5xAX4

Be sure you extract this to any folder, or your desktop, this will have all the basic tools you'll need when it comes to porting for today's lesson.
Getting to know your tools.
Now that you have the tool pack, we are now going to go through them all, what they do exactly, and how to use them. So turn on your favorite music, and sit back and get ready to look at each and every one of them.

The first one we are going to look at is the first one called 'GMADExtractor'
This tool is practically a basic when you want to extract any of your GMA files that is the newly compressed file for the Garrysmod Workshop. You can use this if you ever have a workshop folder on workshop that you want to extract and update which has all the contents.

The next one you have is the 'GUIStudio'. This is the most imporant tool out of all the features. It is what you would use to compile the models all together into garrysmod and other sets of features for it. Whether the model you are uploading is an entity, a standard model, or a ragdolls, this is what does it all. Make sure you keep that.

The next is MDLDecompiler which is basically self-explanatory by the name of it. It decompiles any 'MDL' format model down to all of its animations, reference files, and generic bodygroups it may include down to what is the 'SMD' format. This is another important thing if you are wanting to update any models you have created.

Another important tool is called 'Milkshape'. Sure, you can go ahead and port models without it, but you would be asking for trouble if you are just starting it. Without Milkshape, you will have a very rough time if you are a beginner. Milkshape is there to basically do the hardwork for you and help you through all your problems. I uploaded the full version no charge, so you have all the features once opening it.

The next one you have is the UPK Unpacker which is to unpack any unreal-engine files, but you do not need this if you don't want to, but we are going to use it today. With the UPK Unpacker, you can unpacker, any games that runs off the Unreal Engine, you can extract the models such as games like Red Orchestra 2, Chivalry Medieval Warfare, Mass Effect, and the list goes on. Keep that incase you want to port from any other of those games, but we are going to use it for this tutorial.

The other one you have is the VPK Extractor. Back then, everything was running off of GCF. But when Source Engine 2 was being created and SteamPipe was uploaded, they went to the new format of VPK. It's another extractor that you don't need, but if you want to extract models and edit about like from Insurgency 2, Half Life 2, Left 4 Dead 2, you get the picture. I'd say keep this if you want to port models from any other source games.

Now another important tool you will get is called the 'VTFEdit'. This is what you would use for all your Materials. The Sourceengine uses its own format of VMT and VTF. This will create any files you have into VTF's. Will get more into this later during the tutorial, so be sure you keep this.

And the last tool you have is the GMPublish Workshop Uploader. Not just models, but any other thing you want to upload to workshop, whether it is Sweps, Entities, Tools, or basic Models, you would use this. If you are wanting to upload your work to workshop, it is important to make sure you have this around unless if you are willing to do the hard way through the command prompt. There is already several guides on how to upload to workshop, so I won't go into to depth on how to use it.

Now that you know what this stuff is used for, it is time to get into the packs of porting.
Beginning your Port.
Alright, you still there? If you made it this far, you are just now getting ready to get into the meat of what you are here to study today and that is porting a model. Grab yourself a drink, a snack, get your favorite music going. So here we go ladies and gents, the beginning of what we are here to do today.

Today, we are going to port a model from Red Orchestra 2 which is an MG-42, cause who doesn't like guns on their first ports? Now if you don't have the game Red Orchestra 2, then you can just simply download the model here: https://mega.nz/#!aFswULLB!bVlcvk8mFRpnvXkyRkCNiwaX8EtcIR2J9gJm_9fkztQ

If you do have the game installed, then pay close attention on how to extract models through this illustrated guide. Other than that, go ahead and skip this part if you downloaded the extracted models already.

The first thing you're going to want to do is open up the file and run the UPK Extractor, do not worry if your virus scanner says it's a Virus, it is perfectly safe. Once it runs, you're going to want to locate the browser where the packages of the UPK Files are being held which is located in this path "Steam/Steamapps/Common/Red Orchestra 2/ROGame/BrewedPC/Packages/weapons"

Once done, it'll open up a new window which show's all the weapons that are avaliable for both sides, including other knicknacks.

Scroll down until you find the file that says 'WP_Ger_MG42_LMG" and you will click on it and press the button that says 'Export located at the bottom of the window.
Let it run, and once it finishes, close it out and a new folder will be created in the UPK Unpacker called 'umodelexport'. And from there you have just exported your first model, give yourself a round of applause.


Now that you have your model, inside you will get an amount of folders called AnimSet,MaterialinstanceConstant,SkeletalMesh3,and Texture2d. First off, ignore the first two, your main focus is the SkeletalMesh3 and Texture2D.

Now let's stop for a moment. Two things can occur right here. There is a program that I forgot to mention called 'Blender'. It is a free program that you can use to update models, create certain things and all that, this is also a very important one. And the best part about it is that it's on Steam. Download it and it won't take for too long. I will show you two things, using it on Blender and just plainly exporting it to Milkshape. For Unreal Engine, you can just port it through Milkshape and get your SMD, but you're going to want it for any other moddeling or porting purposes. Download Blender on Steam here. https://steamhost.cn/app/365670/


Now that you have Blender, let's get back on track. Open the Program up and let it run. First thing you're going to need to do is enable the import/export feature for PSK/PSA Files by going through the User Preferences. A seperate window will open, and you will select the Addons tab and scroll down until you reach the feature of importing/exporting PSK/PSA. Enable that.

Alright, now that's done, select 'File', then go to 'Import' and Import a skeleton Mesh
(Made a mistake in the picture below, don't click on the pskx, click on the Skeleton PSK. Sorry for the inconvience.)
.
A new window will open, and you will open up the folder that you just exported from your game and select the SkeletalMesh3 Folder and Select the Ger_MG42.psk file.

The file will open and you will get the MG-42 Model on the screen. Turn it around, look at it, admire that you have just ported a model on the Blender Program.
Now that you have the model on here, the first thing you are going to do is select the 'Arm Object', the press the 'del' key and click the delete button.

Now you have deleted the Animated Arm Models, that'll help you a lot with just getting the simple model up. And guess what, that's all you had to do. Now it's ready for the Compiling Process. See, it's not so bad. What you are going to do is go to 'Export' and export it as an 'obj' format. Once you're skilled on your own, you can export it in different formats, but obj is the most basic if you're starting out. Make sure to export it to your desktop for easy reach, and rename it however you want.

Now that you extracted it, you will get two files. One of them is the 'obj' and the other one is a 'mtl'. Go ahead and delete the 'mtl' since you do not need it. Now that's out of the way, it is time to get some textures. Open the VTFEdit Editor and run the program. Again, if you get any Virus Warnings, just ignore it.

Alright, now here we go with Textures. The thing about textures is that there's the simple Diffuse, but more complex models have three others. Normal, and Specular. These give the default textures a kick and make it look the model 'A' Class. So here we go, and it's as simple as this.

Open the File tab and scroll down to 'Import'. Then you will go where you have the MG42 Pack located and go to the folder 'Texture2D and you will find the 'TGA' files there.

The three files that are circled in that red ink is what you will need. We will start by importing the Diffuse file that is ended with the 'D' format. Select the 'Ger_mg42_lmg_D.tga'

Once it's opened, you are going to go to 'File' and Save As, and from there you will save it to your desktop as 'mg42_diffuse'.

Now, you are going to do the same with the 'Normal' and the 'Specular' files. While you do this, let me take the time to tell you waht these mean.

The 'Diffuse' format is basically the texture itself. It is the color of the handguard, the material of the chamber, anything you can think of. You use this for the basic texture of the model.
The Normal is what gives the model a bumpmap in-game, making it look more realistic and clearing out any holes that the gun may have.
The Specular sharpens the guns detail and puts more ways of shadowing when in light, or in other enviroments that the map it maybe on.

Open the Ger_mg42_lmg_N File and save as on the desktop once more as 'mg42_normal'.

Open the Ger_mg42_lmg_s file and save as on the desktop once again as mg42_specular'

Alright, now you have your vtf textures, what you are going to do now is go to your 'Garrysmod/Garrysmod/materials' folder and create a new folder, naming it 'models'. If there is one already in there, simply click into it and create another folder of your choice, but for the tutorial name it 'Red Orchestra 2'.

*Continue on next section.*
Beginning your Port (Part 2).
(Blasted Text Limit)

Now that you have the files in there, we are going to create a 'VMT' file. A VMT is the main text file that implements all of the textures into the weapon. So we are going to use a special kind to make the model look in-game. What you will do is create a text document with the ending function of .vmt. Now, when you name it, it has to be the same name as the 'mg42_diffuse'. When finished, it'll look like this.

Now, we are going to edit the file. So once you open it, you are going to use this 'Exact' Format.

"VertexlitGeneric"
{
"$basetexture" "models/red orchestra 2/mg42_diffuse"
"$bumpmap" "models/red orchestra 2/mg42_normal"
"$ambientocculusion" "models/red orchestra 2/mg42_specular"
"$surfaceprop" "Metal"
"$nocull" 1
"$halflambert" 1
"$nocull" 1
"$phong" "1"
"$phongexponent" "20"
"$phongboost" "1"
"$phongfresnelranges" "[.3 1 7]"
}

The '$basetexture' is your diffused and default texture. You will put it in the folder place of that. Then you will have '$bumpmap' which is what makes the model pop out with its textures. And the last one you don't need, but if you want to be fance you use the 'Ambientocculision'. Some models have AmbientOcculusions already done, but if not you will put it in the place of the Specular detailed format. Once it's all done, it'll look like this.

Alright, and now you got the textures done. We are almost through, if you haven't left yet then get ready, cause it's about to get hot. We are now going to combine it all together and get ready for the compiling process.

So what you are going to do now is open your Milkshape Program. Do not worry if your virus scanner goes off like before, it shouldn't but incase if it does it is perfectly safe.

Once run, you will get a window that looks like this.

Now here we are to this part, pay close attention because I really can't illustrate this part very well. You are going to click 'file' then hover the mouse over 'import' and then select the 'Wavefront .Obj' A new window will open and you will select the 'mg42.obj' which will open up.

Now that you select it, it will open up and it will reveal the model that you have for the 'MG42' that you ported on Blender ago. If done correctly, you get this.

Okay, now here comes the texture part. What you need to do is go to the 'tools' window and click on the 'select' button and make sure that the 'group' button is also enabled. You will drag a box over the weapon and it will highlight the model red.

Once highlighted, you will go to the material tab and go to the window where you select the 'new' button which creates a new overlay for the material and you will click on the '<none> tab.

By clicking on the <none> tab, you will now go to the folder where you have the texture VTF files at. They 'HAVE' to be in the directory of Garrysmod and in the materials file and the folder name of your choice. If it's in the desktop and you do it like that and then port it, you're going to get a Texture Error. What it's doing is that it's writing the material path in the model, so it Has to be in there.

Now that you have that selected, you maybe thinking why isn't it on the model? You have to click the 'assign' button in order for the material to cover the model. Once done, then you will see the texture of the model.

"PWAISE DA LAWRD!!!!!" You actually have a working model. If you are still this far, a high-five to you. We are now almost done and comes the last section which is compiling. Now what you are going to do is go to the taskbar, click the 'File' tab, go to 'Export' and the very first selection which is a 'Half Life SMD'. You will select it, and direct it to your desktop. Save it as a 'ref' file name in short for 'reference'. You don't have to name it 'ref', but it's recommended if it's just a simple model. Another window will pop up, click the bubble on 'Reference' and don't check Vertex Weight.

And now we have our 'SMD' file. Now we are ready for compiling.

Compiling your Model.
Here we are, the home stretch of porting which is compiling your model. As simple as anything, as long as you have a correct QC file, it is as simple as shooting a basketball through a hoop. Pay close attention to what I'm about to do. Create a new folder of your choice, I'm naming it 'MG42' for simplicity.

Now the things that comes to compiling a model is that you need a 'mdldecompiler' and an 'idle.smd'. I supplied both of these to you here: https://mega.nz/#!mRdXSLIb!ZWFTyFuFJq1YGVAG1fWGSb9hduIHanXGV_SBiNdKfTA

Once you have it extracted in your desired porting folder, it's now a matter of correct file paths.

Now we are going to create a 'QC' file. Open a note pad text and copy this format down and paste it in it.

$cd "C:\Users\jess\Desktop\mg42"
$modelname "Red Orchestra 2/mg42.mdl"
$model "studio" "ref.smd"
$cdmaterials "models\red orchestra 2\"
$hboxset "default"
// Model uses material "mg42_diffuse.vmt"
$surfaceprop "model"
$illumposition 1.976 -1.162 -1.269
$sequence idle "idle" loop ACT_VM_IDLE 1 fps 30.00
$collisionmodel "ref.smd" {

$mass 8.0
$inertia 1.00
$damping 0.00
$rotdamping 0.00
}


This is your 'QC' file for your compiler. Make sure they are in correct format.
The $CD' Is the location where your folder is, recommend having it in your desktop.
The $modelname is the name of your model that will appear in-game once you compile it. Simply
put up with a holding folder and the name of the model itself.
The $model "studio" is the name of your smd which is the MG42.
The $cdmaterials is the location of the materials for your model
The // Model uses material Is the vmt that your model uses. If your model has multiple of these, you would simply include more of these..
The $collisionmodel is the actual impact of the model. Collision models can be made on their own, but in the sake of this tutorial, all you will do is just put the name of the model of your smd and it will auto-generate one for you.

The rest is not important, just be sure your QC looks like this.

Once you have that, save it with '.qc' at the end of the text, then what you are going to do next is place your 'ref.smd' in the file, and be sure all the correct paths are initialized. In the end, you will have three files, the idle.smd, the mdldecompiler.qc, and the ref.smd. It'll look like this.

Now, in this part, you need to have Team Fortress 2 and SourceSDK Installed. When it comes to compiling models, it is a must that you have the source engine for it and the developer tools that is included with it. You can find it here which is now for free.
https://steamhost.cn/app/440/

Once you have it installed, you are going to open and run the program 'GUIStudio'. To most of you, it will be a first time opening it and it will ask you to set the paths. You are going to set the Orange Box Path which will be located in the Team Fortress 2 File simply put in this path Steam/steamapps/common/sourcesdk/bin/orangebox/bin

If it doesn't work, or you get an error, run Team Fortress 2 atleast once, and run Source SDK and try again.

Now that it's complete, you should be at this.
Once you are there, the next thing you are going to do is where it says 'Target Mod or "GameInfor" path, you are going to click the add button.

By doing that, you open a new window. You are going to go to your "Steam/Steamapps/common/garrysmod/garrysmod" and select the GameInfo.txt located at the very bottom.

Now that the Game Info path is selected, it would read 'Garry's Mod'. Now here comes the last part that you need to do, and get ready. You are going to select the 'File' button on the top left, and select 'LoadQC'. From there, find the folder that you have the 'mdldecompiler' and model reference located.

Now that you have done that, your QC has been loaded, now all you have to do is select the 'Compile' button located on your actions tab, and let the program run its course.

Do not be afraid if it freezes and it says (Not Responding), it's simply running its couse and its normal for big files. Just be patient.

And Congratulations! You have just compiled your first model!

Model Complete!
Congratulations, your model is now completed and it is finished.


Now I get it, some of you are new. When I first started, there were no guides and I had to do it all myself and figure everything out on my own and it was brutal. But I hope that transferring my knowledge to you guys on how I do this will help you all out when your starting it. Don't expect to be a 'Kali' or a 'NinjaNub' when you start porting. Your first one may be ♥♥♥♥, but that's okay. Cause the more you port and practice, the better you get at it and the more familiar you become with it.

I hope this tutorial has done a lot for you, if you have any comments, questions, or need some extra help, please let me know and I'll reply to them to the best of my ability as possible. Please like if this tutorial has helped you out.

However, if it was a success for you, then congratulations. Please keep the model station as a gift from me. We need more porters for this community, and I hope this helps some of you. Thank you, and have a wonderful day!


ALSO! If you want to continue to practice porting models, go to this website where you can download all the free models you want and port them all day. http://tf3dm.com/
186 Comments
shadowpanda333 15 Nov, 2024 @ 12:30am 
I want to Upload the Skrill dragon.
E7ajamy 25 Mar, 2024 @ 7:26pm 
don't mistake this tutorial. it may be old, but it is the source of the original idea of making bodygroups, especially for weapons. in example, making the slide move back and fourth. let alone that compiler he is using. it's old yes, but we have crowbar. just don't forget where things got started that from that time, improvement has been made better.
Electric Blood Mage 25 Mar, 2024 @ 6:11pm 
This is an old ass tutorial. please don't use it lmao
thgangster43 7 Nov, 2023 @ 5:35am 
link is dead, does anybody still have the tools?
ꜱʜᴇᴩʜᴀʀᴅ. 27 Oct, 2023 @ 3:37pm 
link's expired
TAY-LIS 22 Jul, 2023 @ 12:55am 
link not working
Diamondback 27 May, 2023 @ 7:37am 
Will this work with Models from the Pack 3D models site?
CINATITSMR 20 May, 2023 @ 12:54pm 
WHY ARE THERE SO MANY TOOLS I NEED I JUST WANTED TO IMPORT A SIMPLE MESH AS A PROP
REL0AD3D_Y33TS3R4M4 4 Dec, 2022 @ 2:24am 
Cheers mate now I can port my just cause 2 or 4 chevalier ice breaker
Barkeus 18 Nov, 2022 @ 4:31am 
is there a way to do this without team fortress 2? it's a 30gb game, i don't have that much space to port a single model