Tutorial: Editing Half-Life Models Last edited 3 months ago2024-09-20 10:55:43 UTC

Download attachment

OK, firstly, this tutorial is NOT designed to teach you how to create models from scratch with MilkShape 3D. It will show you how to edit existing models and give them new heads/weapons etc., or how to replace old heads/weapons.

Before we start, there are a few programs you will need: In this tutorial we will use the high definition hgrunt.mdl as an example again. First, extract the models you want to edit from the pak files.

(In HL, pak0 is low definition, pak1 is high def. For OpFor, pak0 is low def, pak2 is high def, and for Blue Shift, pak2 is both, depending on whether you have the high def pack installed or not.)

Now, I recommend you create a new folder for the models, and put the specific ones there, in this case, hgrunt.mdl.

Time to load up MilkShape 3D.

(It can be registered, unregistered or expired, all will work ok for this).

At the top, click on tools, scroll down to HL and select "Decompile Normal HL MDL file". Browse to the model in its new folder, and select it. Check every box. Wait for it to finish decompiling, and open up the folder. You will see a load of extra files.

They are: Head Replacement:

Open up hgrunt.qc in Notepad (or something similar), and scroll down until it says something about head groups. You will see 4 lines below which refer to various head SMDs. In the provided hgrunt model, I have deleted all of the references except the third (I merely reskinned the third head) and replaced them with references to some of the hgrunt_opfor's head SMDs.

To make life easier, I renamed the hgrunt_opfor ones with easier to recognise names (So with the MP head, which is the second head on the provided model, I renamed the SMD to MP, and referred to that in the QC. I called the first and fourth heads Beret and BeretBlack to make life easier still.)

Now, when you have replaced everything you want, you may want to edit some of the textures of the new heads (like the beret, which I made red).

Read my reskinning tutorial for more detail on this. When you have finished it, it must be 256 colours or it won't work.

After you have done that, compile the QC file through MilkShape 3D (Tools, HL, COmpile QC file). After compiling, open up hgrunt.mdl and voila! It will have new heads with the new textures. If the textures don't come out right, you can always reskin even further.

Adding Heads

This is very similar to head replacement. However, instead of replacing old ones, copy one of the lines and paste it below. Now change the SMD reference in the cloned line. Now continue as normal.

Weapon Replacement

Almost exactly the same as head replacement, but refer to the weapon SMDs. Also, you'll have to scroll down in the QC file to the weapon section rather than the head section. In the example, I have replaced the high def hgrunt's M4A1 rifle with an MP5. However, the normal HL MP5 looks old, grey and dusty. Hgrunt_opfor.mdl has a nice shiny black MP5, so I referred to that. I also used hgrunt_opfor's shotgun, which is a nicer version of the shotgun from the low def hgrunt.mdl.

Adding Weapons

Again, almost exactly the same as adding heads, but you add the weapons to the weapon section of the QC file.

After you have edited the model all you want, compile the QC and you have a nice new model!

Bug Warning

Do not try adding weapons or heads to existing models unless you are recoding HL for a mod. It completely mucks stuff up, I tried giving hgrunt_opfor.mdl new heads and weapons once, and even though I edited the FGD so I could select the new stuff, the hgrunt kept displaying the wrong heads and weapons, and for some reason it also mucked up the alignment of some scripted_sequences. You know the guy on the stretcher from the start of Opposing Force? He was hovering behind it!

I suppose you could use Spirit and custom models to get round this problem, but I haven't tried. Basically, I would just replace existing stuff. You can always unpack the models from the pak files again and overwrite the edited ones if you don't like 'em.

Adding or Replacing weapons which are not on any existing model

Let's say you wanted to give the hgrunt a 357 Python Revolver. None of the HL models have 357s. As a result, you have no reference SMDs. So what do you do? Fortunately, there is a simple solution. Open up MS3D and decompile the p_model of the weapon you want (In this case, p_357). There will be a reference SMD there. Simply put it in the hgrunt's folder and refer to it in the QC file. Now compile as normal.

With this, I managed to give an hgrunt the AK47 with a bayonet from Firearms. It came out pretty well too!

Adding Sequences

But what if you wanted to give your new hgrunt some of hgrunt_opfor's extra sequences? This is the easiest bit. Open up hgrunt_opfor.qc, copy the sequences you want from it, and paste them at the bottom of hgrunt.qc. Also, you will need the sequence SMDs if they aren't already in the folder.
GruntGrunt
Distortion warning

The more times you compile and decompile a .mdl file, the worse it gets. I would recommend you only decompile a .mdl file once, because the more times you decompile one, the more distorted it gets. Animations seem to shift themselves, mouths become angled slightly, textures get pushed along a bit...this makes it look horrible sometimes, particularly with heads with glasses, where the frame seems to get shifted a bit after the first decompile.

If that happens, change the glasses into sunglasses to hide this. If you feel you have completely mucked up a model, unpack it again and start from scratch.

Stuff in the Download

Strangely enough, not a map. Instead, the edited hgrunt.mdl (without the AK47) which I was talking about earlier on. I would've included the AK47 grunt, but I deleted it :(

Happy remodelling!

By the way, you can also use the same methods mentioned in the tutorial to replace other stuff on a model, like torsos (See hgrunt_opfor.mdl for reference).

5 Comments

Commented 16 years ago2008-09-30 09:51:05 UTC Comment #100641
thanks
Commented 14 years ago2010-07-05 21:31:17 UTC Comment #100642
Hi, I'm trying to edit a The Specialists model. It has a katana sheathed at it's hip, I'm trying to remove this katana. Is it possible via this method? As I've looked and I can't see how :(
Commented 9 years ago2015-05-15 13:34:42 UTC Comment #100643
Can i compile the SMD files or i can only compile the QC files? I am asking because i want to add the original hgrunt animations to the heavy weapons grunt.
Commented 8 years ago2016-03-06 19:46:58 UTC Comment #100644
make a video and link it plsssssssssssssssssssssss
Commented 1 hour ago2024-12-21 15:35:14 UTC Comment #106567
This tutorial is severely outdated. Someone should write an entirely new tutorial from scratch that uses modern tools (Crowbar, Blender, HLAM)

You must log in to post a comment. You can login or register a new account.