Cleanup is going to take awhile, so the site is back up but editing has been disabled.
Converting 1.6 Models
From HalfLife 2 Knowledge Base
Contents |
Requirements
You'll need the SDK and a skin you want to start with. if this is your first time i highly suggest not using a player model.
You'll need some experience with this type of stuff.
And, as with most of my tutorials you will need photoshop cs. One extra thing you'll need is Milkshape 3D, you can get that here:
http://www.swissquake.ch/chumbalum-soft/ms3d/download.html
Tutorial
Part 1: Decompiling your original model
Skip this if you already have the textures, smd and qc.
- install and open Milkshape 3D.
- go to tools > kratisto's half life MDL decompiler 1.2
- open your mdl (you might want to put it in its own directory first)
- it will come up with a series of lines telling you it has decompiled the model.
- go to the file with the model in it and you will find a series of smd files, bmp files and one qc file. These are they animations, textures, and the file that tells us how to compile it again.
Part 2: Converting your textures
- go to the folder with your base files in it (smds, bmps, qc)
- ctrl select all of the bmps and right click, select edit with photoshop cs.
- photoshop will open with the textures from the model in it.
- go to each one and choose image > image size, and make the width and height a power of 2 - eg. 32, 64, 128, 256, 512 etc. - if you had #silencer image or something along those lines that started out to be something like 260x 60, you would resize it to be 256x60 - just try not to scale upwards as it can decrease quality.
- save them as tga files and convert them to vtfs using vtex.
- this is where you will need to know the game name of your weapon, eg if your doing a usp it is pist_usp or an m4a1 is rif_m4a1... these can all be found in the gcfs.
- copy your vtf files into steamapps/ [ youraccountname ] /sourcesdk/cstrike_sample_content/materials/models/weapons/v_models/weapon_name/
Part 3: Getting dirty with your qc
Before starting here copy all your base files to sourcesdk/cstrike_sample_content/models/weapons
- go into your cs:source gcf file and find your weapons mdl - it should be in cstrike/models/weapons/
- extract the mdl and open it in notepad. you will see a whole pile of crap. we are only interested in the last line. go down to that.
- open your weapons qc. There are a lot that needs to be done but we are going to do the harder stuff first.
- towards the bottom it will say //animation sequences (#) or something along those lines.this is where we are going to edit.
- for each animation name eg. "idle" or "shoot1" we need to find the corresponding source name that goes with it, eg ACT_VM_IDLE. you can do this by going back to your mdl in notepad and pressing ctrl+f. this will bring up the search module of notepad, type in your animations name, and keep pressing next until you find one with a name in capitals after it.
6. Copy that name and between the first title of the animation sequence and the second repeated title of the animated sequence add this:
"ACT_VM_TITLE" 1
Except replace it with whatever title you have. Here is a before and after fragment from my 1.5 knife.
Before
$sequence "idle3" "idle3" fps 15 $sequence "draw" "draw" fps 30 $sequence "stab" "stab" fps 37 $sequence "stab_miss" "stab_miss" fps 37 $sequence "midslash1" "midslash1" fps 37 $sequence "midslash2" "midslash2" fps 37
After
$sequence "idle3" "ACT_VM_IDLE" 1 "idle3" fps 15 $sequence "draw" "ACT_VM_DRAW" 1 "draw" fps 30 $sequence "stab" "ACT_VM_HITCENTER" 1 "stab" fps 37 $sequence "stab_miss" "ACT_VM_MISSCENTER" 1 "stab_miss" fps 37 $sequence "midslash1" "ACT_VM_MISSCENTER" 1 "midslash1" fps 37 $sequence "midslash2" "ACT_VM_MISSCENTER" 1 "midslash2" fps 37
If you look closer it is not that hard to see what we are doing here:
Before
$sequence "idle3" "idle3" fps 15
After
$sequence "idle3" "ACT_VM_IDLE" 1 "idle3" fps 15
After you have done all of that, you've done the hard work in the qc, and it's all downhill from here.
Part 4: Cleaning up with your qc
Now we need to clean up the qc file so it will compile for source. 1. If you have the $cdtextures line delete it - we don't need it. 2. Change your $modelname line to be
$modelname "weapons/v_weapon_name.mdl"
Remember it won't work without the "v_"
3. Add a line like this
$cdmaterials "models/weapons/v_models/weapon_name/"
4. Save your qc - you're all done!
Part 5: Compiling to an mdl
1. Go to your sourcesdk/bin folder. create a new file in notepad and add the following
Studiomdl.exe [ steampath ] /steamapps/ [ youraccountname ] /sourcesdk/cstrike_sample_content/models/weapons/your_qc_name.qc Pause
Save that as qc-comp.bat 2. Close notepad and run the file. if it has some error then aborts, double check you did step 3 properly. 3. Copy the ffive new files in your sourcesdk/cstrike_sample_content/models/weapons/ directory to steams/ [ youraccount ] /counter-strike source/cstrike/models/weapons/ 4. Play the game to check it worked. If you experience any pink'n'blacks, double check your vmt files are pointing to the right place.
The downside
At the moment we cannot put source arms on for two reasons. One reason is that we can't decompile their models, we don't have the tool. the second is that the way to do it without decompiling would not turn out right because it would be using the original files animations on your newly animated object - it would be very screwed up.
Credits
omega552003 cannonfodder

