Tutorial made by demon_firefox - powered by Demon-Coding
The FPS Customization Community
Install '[Decompiler] Jeds Half-Life Model Viewer.exe' and '[Compiler] Gui studio.mdl.exe'.
You can find both of them in the 'tool'-folder.
First of all you have to start Jed's Half-Life Model Viewer.
Set the path to 'studiomdl.exe' and 'mdldec.exe'. You can find them in the 'tool' folder, too.
The best is when you copy the files in the same (install)folder of the Model Viewer.
To set the path (open Half Life Model Viewer) and go to 'Tools' -> 'Configure Tools'.
Now let's getting started.
Go to File -> Load Model...
Then open your v_weapon.mdl-File. (e.g. v_ak47.mdl which is located in the 'example' folder).
So you can make sure that you hack the right weapon ;)
You should see the default model with 1.6 arms.
To decompile the model go to 'Tools' -> 'Decompile model' and select your v_weapon.mdl-File (if this doesn't work check if you've set the tool-paths correctly!)
If the model has been sucessfully decompiled continue with Step 3
Let's take a look in the example folder.
There you will find a lot of files (mostly .bmp, .smd, .qc and .mdl).
To change the arms open the v_weapon.qc-file with notepad (not Word!).
My qc-file looks like this:
Original internal name:
"v_ak47.mdl"
==============================================================================
*/
$modelname "v_ak47.mdl"
$cd ".\"
$cdtexture ".\"
$scale 1.0
$cliptotextures
$bbox 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
$cbox 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
$eyeposition 0.000000 0.000000 0.000000
//reference mesh(es)
$body "rhand" "rhand"
$body "lhand" "lhand"
$body "weapon" "f_ak47_template"
// 2 attachment(s)
$attachment 0 "Bone 04" 2.750000 -22.500000 2.900000
$attachment 1 "Bone52" 0.000000 -3.000000 0.000000
// 4 hit box(es)
$hbox 0 "Bone04" -1.980000 -8.880000 -1.020000 1.730000 0.030000 1.090000
$hbox 0 "Bone_Righthand" -1.340000 -2.980000 -0.410000 1.430000 0.000000 0.630000
$hbox 0 "Bone01" -1.720000 -8.900000 -1.020000 1.990000 0.020000 1.090000
$hbox 0 "Bone_Lefthand" -1.520000 -3.073735 -0.410000 1.250000 0.000000 0.630000
// 6 animation sequence(s)
$sequence "idle1" "idle1" fps 30
$sequence "reload" "reload" fps 37 { event 5004 13 "weapons/ak47_clipout.wav" } { event 5004 57 "weapons/ak47_clipin.wav" }
$sequence "draw" "draw" fps 30 { event 5004 11 "weapons/ak47_boltpull.wav" }
$sequence "shoot1" "shoot1" fps 20 { event 5001 0 "22" }
$sequence "shoot2" "shoot2" fps 20 { event 5001 0 "22" }
$sequence "shoot3" "shoot3" fps 20 { event 5001 0 "22" }
// End of QC script.
Just one part is important for us:
//reference mesh(es)
$body "rhand" "rhand"
$body "lhand" "lhand"
$body "weapon" "f_ak47_template"
This is a default 1.6 model. The way this part will look defenetly change!
In this example you just have to change two values.
$body "rhand" "rhand" to $body "rhand" "hands"
$body "lhand" "lhand" to $body "lhand" "hands"
If you can't find the lines and there is just...
$body "weapon" "f_ak47_template"
...add the following lines and go on with Step 3.1: (Please note the second value (e.g. f_ak47_template) down! We'll need it soon)
$body "rhand" "hands"
$body "lhand" "hands"
Otherwise you can skip this part and go on with Step 4.
To continue please Download & Install Milkshape 3D.
Open Milkshape and klick on File -> Import -> Half-Life smd...
Now go to your 'example' folder and select the noted down file (e.g. f_ak47_template.smd).
(Klick to enlarge)
Make sure that you have activated the first two options! (The 3rd one isn't really important for us)
Go on the right toolbar and select the category 'Groups'.
Then delete 'view_skin.bmp', 'view_glove.bmp' and 'view_finger.bmp'
(Klick to enlarge)
Let's export it.
Go to File -> Export -> Half-Life SMD... and save (and replace) your file with the original name (e.g. 'f_ak47_template.smd')
(Klick to enlarge)
Get the two files of the 'needed files' folder and copy them in the 'example' folder.
(Klick to enlarge)
Now the hack is nearly done!
Run 'GUI StudioMDL' and open your .qc-file (e.g. 'v_ak47.qc')
You should see a message like this:
[Opening QC file - C:\example\v_ak47.qc]
[QC loaded O.K!]
Now klick one compile button (right bottom). If you've down everything the right way there should not be any error and you'll get something like this:
[Performing Sanity Check]
QC file loaded...PASS
Can read QC...PASS
Can find studiomdl.exe...PASS
Can build command line...PASS
All tests passed!
[Compiling QC file - "v_ak47.qc"]
[Compiler output follows]
--------------------------------------------------------------------------------
entering v_ak47.qc
grabbing .\/hands.smd
grabbing .\/hands.smd
grabbing .\/f_ak47_template.smd
grabbing .\/idle1.smd
grabbing .\/reload.smd
grabbing .\/draw.smd
grabbing .\/shoot1.smd
grabbing .\/shoot2.smd
grabbing .\/shoot3.smd
BMP handfinal256.bmp [512 510] (100%) 261888 bytes
BMP wood.bmp [128 64] (100%) 8960 bytes
BMP lower_body.bmp [256 128] (100%) 33536 bytes
BMP forearm.bmp [128 64] (100%) 8960 bytes
BMP barrel.bmp [256 128] (100%) 33536 bytes
BMP upper_body.bmp [256 64] (100%) 17152 bytes
BMP reticle.bmp [64 64] (100%) 4864 bytes
BMP handle.bmp [64 64] (100%) 4864 bytes
BMP magazine.bmp [64 128] (100%) 8960 bytes
---------------------
writing v_ak47.mdl:
bones 5252 bytes (42)
sequences 22360 bytes (190 frames) [0:06]
vertices 22040 bytes (750 vertices, 945 normals)
mesh 18244 bytes (1490 tris, 350 strips)
vertices 22040 bytes (750 vertices, 945 normals)
mesh 18244 bytes (1498#@0 tris, 350 strips)
vertices 6076 bytes (258 vertices, 209 normals)
mesh 6660 bytes (454 tris, 158 strips)
models 93868 bytes
textures 383460 bytes
total 504940
--------------------------------------------------------------------------------
[Compiler execution completed]
Contgratulations! You've finished the hack.
At least a screen of the finished work: