Playermodel Tutorial

Started by Silver Knight, 20-01-2010

0 Members and 1 Guest are viewing this topic.

Silver Knight

1. Get the tools! http://www.megaupload.com/?d=BLQUXLI5 Here's my development tools folder which contains the MDLDecompiler and the GUIStudioCompiler
Decompile the model you want. (I put my decompiled models in my documents "decompiled models/<nameofmodelhere>" so I can go back to it later)

2. Get Notepad++
http://notepad-plus.sourceforge.net/uk/site.htm
It's alot beter than the old notepad.

3. 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"

Kleiner:
$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


4. 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" )

Quotebreslau: if i cant cheat i dont wanna play
breslau: period

Silver Knight


Quotebreslau: if i cant cheat i dont wanna play
breslau: period

Silver Knight


Quotebreslau: if i cant cheat i dont wanna play
breslau: period

Sickness

Reserved





Very very interesting...
Rusty - Returned to the Zone

KingArthur

Harder then it looks, I got every aspect of it working besides textures- cant get the file path right.

Storm_Shield

Already confused.
I'm back from the dead...

Frostee