• Home
  • Arch & Design
  • Games & Demos
  • About
  • Contact
  • Blog
Charles Conard's 3D Art
(717) 576-8024

How to Make Playermodels and NPCs for Garry's Mod

3/16/2015

27 Comments

 
A long time ago in 2009, I made many different playermodels for a game called Garry's Mod. I made this tutorial a long time ago, but I decided to make a copy of it here before it eventually gets purged from it's original post.

Many of the things listed below may be outdated, the steps for preparing the model are mostly the same.
Here are the steps you should follow to get started.
Step 1. Decompile the model you want. 
Crowbar seems to work for most people and all of the older tools no longer work after the SteamPipe update.
https://steamcommunity.com/groups/CrowbarTool
(I put my decompiled models in my documents "decompiled models/<nameofmodelhere>" so I can go back to it later)

Step 1.5 
Can't decompile the model? Open the .mdl in notepad and change "IDST0" into "IDST," 

2. Get Notepad++
http://notepad-plus.sourceforge.net/uk/site.htm
It's a lot better than the default notepad that's packaged with windows. Plus it gives you numbered lines to help you identify errors easier when they arise.

Step 3. Edit the model .qc 
You might want to change the model path so you don't overwrite any other models.
So just edit this line to where the model will go

$modelname "<modelpathhere>.mdl"
ex. $modelname "$modelname "player/barney.mdl"
(the models subpath is added automatically)

and change the "$includemodel" to what you want it to be.
Here's a list of your anim choices
Animation Types and Combos

    
If you're making a CS:S model into a playermodel, you will want to remove this line. Otherwise you may end up with weapons not being positioned properly.
Fix for "Crotch Guns"

    
If your compiler says: "Eyelid "lower_right" neutral out of range (+-0.5)"

Then remove these lines.
Picture
If your compiler says: "unknown flex AU27ZR"

Then remove the flex at the end of the flex data just above the $lod stuff and one of the parentheses at the end of the line
Picture
Step 4. Compile and Test
Download and install GUI studio mdl,

http://www.wunderboy.org/apps/guistudiomdl2.php

by now you should be able to just compile it, go to the target directory, retrieve your model, and be able to fully use it.

Open the Source SDK modelviewer to test your model.

When you've tested all of the anims in modelviewer, you may then proceed to add your custom playermodel / NPC to Garry's Mod.

Make a lua file in "garrysmod/garrysmod/lua/autorun" and name it the whatever you want (you might want to name it whatever the model is named and add "_player" to the end)

Open the lua file and add these lines for a playermodel.
Player Manager Template

    
Here's an example
Player Manager Example

    
Make a lua file in "garrysmod/garrysmod/lua/autorun" and name it the whatever you want (you might want to name it whatever the model is named and add "_npc" to the end)
Open the lua file and add these lines.
NPC Template

    
Here's an example
NPC Example

    
27 Comments
code_gs
6/8/2015 06:43:13 pm

A few things have changed with GM13:
1. The list.Set in the lua code is no longer needed; AddValidModel handles all of that.
2. GUIStudioModel is no longer needed since Crowbar now handles compiles as well.
3. Only m_anm.mdl and f_anm.mdl are needed for playermodels now; the others were deleted and packed into one animation file. cs_fix.mdl was also deprecated.
4. I would make a section recommending people to go into Blender/3DS and deleting the weapon_bones on CS:S playermodels or else they will experience weapons going underneath the player.

Reply
Charles Conard
6/9/2015 09:48:02 am

Thanks for the information, I'll revise the tutorial to the new methods.

As for the the weapon_bone, deleting "$ikchain ikclip ValveBiped.weapon_bone_Clip knee 0.707 -0.707 0.000" is a quick and dirty fix for those who don't want to dive into a modeling program just yet. This is how I was doing it before I got into modeling programs.

Reply
James
9/14/2017 10:29:59 pm

we are the same

Reply
xDShot
6/9/2015 05:50:45 am

Why do we have to decompile? There are great source files for models from garry itself (which have proper options like hitboxes, bone-defines eetc.) and available for downloading from wiki page!
http://wiki.garrysmod.com/page/Player_model_compilation

The arms for 1-st person view are available too:
http://wiki.garrysmod.com/page/Using_Viewmodel_Hands

Reply
Charles Conard
6/9/2015 09:50:02 am

This is a tutorial to covert models that weren't made into playermodels. There's a large selection of ragdolls on the Workshop that do not have playermodel support. This tutorial teaches you how to do that on your own.

Reply
CCCRIDER
8/26/2015 10:13:08 am

I downloaded crowbar, but I can't get it to work. It doesn't download the way it's supposed to.

Reply
Kevin Liu
12/10/2015 07:45:33 pm

I have tried everything but no matter what I can't seem to load my npcs in the game. For some reason it says "models" out of bounds.

Reply
Hm.
4/8/2016 09:31:27 am

... I almost cried that was so complicated.

Reply
Hm.
4/8/2016 09:32:50 am

Also, there's no .qc file.

Reply
FatalitySonic2
4/23/2016 12:32:02 pm

Hi there and thanks for the tip about converting CS:S models to GMOD. It helped me to convert a CS:S mod into a playermodel successfully. But there's one problem.

I did a conversion of a L4D2 mod to a GMOD playermodel. It was successful but the neck was barely visible (the playermodel in question has been published to the workshop, search for Rosalina Playermodel by myself). Maybe because the skeleton was different (it was a Rochelle mod so it may explains why). Do you have any explanations about this problem? It would help me to fix that problem. If you don't have one, that's fine.

Reply
Charles Conard
4/26/2016 12:27:39 am

Left 4 Dead models are not on the standard skeleton size that HL2 and CSS use.

Reply
Zane Weaver
6/8/2016 10:46:53 am

Hey m8 can you make a ragdoll/npc to a playermodel for me (gmod)?

Reply
Lucario
8/21/2016 03:13:59 pm

Okay so I have an issue, I'm finding that not only is the notepad++ not really working well with the .mdl file, I there is no .qc file included in the file I downloaded, is there a way to fix this? can I copy/paste another .qc file from a different model?

Reply
Charles
8/21/2016 09:23:51 pm

Read those first few steps a little more carefully. The .mdl file is to be decompiled with Crowbar. After the model is decompiled, then you will have the .qc file.

Reply
Lucario
8/22/2016 04:20:17 am

Oh thank you very much!

Lucario
8/22/2016 10:07:06 am

And one last question, the model im trying to make into a player model is just a prop at the moment, is there anything special I must do since there isn't anything after step 2 to do?

MemeLord9000
5/23/2020 08:02:02 pm

Reply to Lucario's Question: "And one last question, the model im trying to make into a player model is just a prop at the moment, is there anything special I must do since there isn't anything after step 2 to do?"
Yes. In the QC you need to keep it as $surfaceprop "flesh" and $contents "solid" if that doesn't work, then IDK

Reply
Skuppernog
9/3/2016 05:54:13 pm

Alrighty then. firstly, i understood about .2% of everything here. please put it in laymans terms.

Reply
Azer link
9/16/2016 02:07:36 am

cj

Reply
leopard28
9/2/2017 09:22:17 am

thanks for the information

Reply
lomhow1234
11/2/2016 07:01:42 am

Hey, I'm a Meme Lord. Do you have any recommendations for those on Mac? I know. I know. It's terrible. I was just wondering if the programs would be backwards compatible?
A lot of the code looks like some kind of HTML and a Java. So I would think there's some programs that would work.

Reply
Leopard28
9/2/2017 09:21:25 am

thanks for your information charles

Reply
Candy Cadet
7/11/2018 03:58:53 pm

This is very confusing to me. All I wanted to do was make Sanders Sides, Candy Robot, and Marshmello playermodels. But now I see it is very complicated and beyond my brain as a candy robot.

Reply
PeachyPrincess1000
5/22/2020 07:04:59 pm

Thanks for the tutorial! Now I can make my Super Smash Bros Brawl Daisy P.M.!!

Reply
PeachyPrincess1000
5/23/2020 08:36:37 am

Umm.... My textures are missing on my p.m.

Reply
PeachyPrincess1000
5/23/2020 07:57:52 pm

I figured it out! I had to put in all the materials in my addon's folder! It works now, thanks!

Reply
KiK Girls Wisconsin link
3/14/2021 09:54:26 am

Great post, thanks.

Reply



Leave a Reply.

    Picture
    View my profile on LinkedIn
    Picture
    Check out my Artstation

    About Me

    I'm a graduate of the Art Institute of Pittsburgh majoring in Game Art & Design with a Bachelor of Science Degree.I have a strong interest in games and the games industry. 

    I try to keep my skills fresh in my spare time by reviewing and researching new methods and tools released for game developers.

    Archives

    March 2020
    March 2019
    January 2019
    October 2016
    July 2016
    May 2016
    August 2015
    July 2015
    March 2015
    January 2015
    November 2014
    October 2014
    December 2013
    April 2013

    Categories

    All
    3D Preview
    Arch & Design
    Doodles
    Fallout 4
    Games
    Garry's Mod
    General Updates
    High Poly
    Modular
    Playable
    Render
    Revisited Projects
    Source Engine
    Substance
    Tutorials
    Unity Engine
    Unreal Engine

    Picture
    Check out my Steam Workshop files and contributions.

    RSS Feed

Proudly powered by Weebly