How to change an NPC to a Player Model?


I am new to GMod, and want to change this NPC to a player model:

How would I do that?


EDIT: Also, when I put addons into my addons folder under Steam\steamapps(username)\garrysmod\garrysmod\addons, they don’t show up in my game. Just the ones I subscribe to in the Workshop (.gma files).


1.Get the tools! MDLDecompiler Fixed, GUI StudioMDL Here’s my development tools.
Decompile the model you want. (I put my decompiled models in my documents “decompiled models/<nameofmodelhere>” so I can go back to it later)

  1. Get Notepad++
    It’s alot beter than the old notepad.

  2. Edit the model .qc

You might want to change the model path so you don’t screw up any other models.
So just edit this line to where the model will go

$modelname "<modelpathhere>.mdl"

and change the “$includemodel” to what you want it to be.
Here’s a list of your anim choices

male NPC:
male NPC:
$includemodel "humans/male_shared.mdl"
$includemodel "humans/male_ss.mdl"
$includemodel "humans/male_gestures.mdl"
$includemodel "humans/male_postures.mdl"

male player:
$includemodel "m_anm.mdl"
$includemodel "m_gst.mdl"
$includemodel "m_pst.mdl"
$includemodel "m_shd.mdl"
$includemodel "m_ss.mdl"

female NPC:
$includemodel "humans/female_shared.mdl"
$includemodel "humans/female_ss.mdl"
$includemodel "humans/female_gestures.mdl"
$includemodel "humans/female_postures.mdl"

female player:
$includemodel "f_anm.mdl"
$includemodel "f_gst.mdl"
$includemodel "f_pst.mdl"
$includemodel "f_shd.mdl"
$includemodel "f_ss.mdl"
CS:S / Combine player

$includemodel "cs_fix.mdl"

$includemodel "Kleiner_animations.mdl"
$includemodel "humans/male_shared.mdl"
$includemodel "Kleiner_postures.mdl"
$includemodel "Kleiner_gestures.mdl"

Police (fixed anims)
$includemodel "Police_animations.mdl"
$includemodel "Police_ss.mdl"
$includemodel "humans/male_shared.mdl"

If your making a CS:S model into a player, you will want to remove this line.

$ikchain ikclip ValveBiped.weapon_bone_Clip knee 0.707 -0.707 0.000

If it says: Eyelid “lower_right” neutral out of range (±0.5)

Then remove the line that says that, and the numbers for it below.

If it 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

  1. Compile and Test
    Open GUI studio mdl,

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.AddValidModel( "modelnamehere", 					"modelpath" )

list.Set( "PlayerOptionsModel",  "modelnamehere", 					"modelpath" ) 

Here’s an example

player_manager.AddValidModel( "ShoTGuNGuY49", 					"models/player/group01/shtgngy.mdl" )

list.Set( "PlayerOptionsModel",  "ShoTGuNGuY49", 					"models/player/group01/shtgngy.mdl" ) 

This was created by Silver.Knight. Fixed the tools and stuff.

I also have some other things like HeadHacking and other stuff.

Okay, I’m getting close! I got it to appear in the menu and I can select it, but when I do, it looks like this:

All I did was take everything from the download I posted above, put it into where it’s supposed to go, and then rewrite the LUA file to what you said, because the model is already made. When I opened it up to do those steps, it was already configured to how it needed to be.

My LUA says:

player_manager.AddValidModel( "HUNK", "models/hunk_orc" );

list.Set( "PlayerOptionsModel",  "HUNK", "models/hunk_orc" );

So what am I doing wrong?

SOMEHOW, I magically made progress. It works totally perfectly! Except for one major issue… this:

I walk around in this pose. However, when I fall, I do react to it:

Can someone please help me? D:

Edit: I just remembered that the NPC that I got the model from runs up to you. goes into this “T” pose when it is not equipped with a weapon.

So now the problem is a bit more knowable.

I compared the HUNK.qc file to that of another official playermodel (one for the Crysis Nanosuit), and they were both the same. So I believe that isn’t the problem, either.

EDIT 2: That is, until I disable thinking. Then they just stand normally with their arms at their sides.

Help, please?

That pose tends to mean its not rigged correctly because I have a few player models that walk around like that as well.


It all came down to silly little lines of code. Such as:

$includemodel "combine_soldier_anims.mdl"
$includemodel "m_anm.mdl"
$includemodel "m_ss.mdl"


$jointmerge "ValveBiped.Bip01_Pelvis" "ValveBiped.Bip01_Spine1"


$animatedfriction 1.000 400.000 0.500 0.000 0.300

Putting those into the model fixed my problem. It’s now perfect! Thanks for all the help guys! :smiley: I was going to shoot “Thanks” into the mirror on that sandbox map I’ve been taking the screednshots from, but I ran out of bullets :expressionless:

I know this is an old post but I’m trying to do the same thing and the issue I’m having is that the NPC files I want to use are GMA and not MDL files, any help?

Do you have any idea how i’d do this?

[editline]13th July 2014[/editline]

Never mind i figured it out

i get this error when i compile how do i fix this?

ERROR: c:\users\aj\desktop est\mdldecompiler.qc(31): - can’t find eyeball texture “eyeball_r” on model
ERROR: Aborted Processing on ‘Humans\Group01\fout_01.mdl’