Journal #2158

Posted 18 years ago2005-07-14 22:32:17 UTC
Dead NPCs

Yesterday I found how to do that. The easiest way to add an NPC is to use a model and a cycler_sprite entity, but you cannot choose animation sequence you want, so you get your NPC safe and sound.

Theoretically it is possibly to arrange something in order to kill the NPC each time the round starts, but I've got a better solution.

I was doing an awp_* map of a construction site, so the background is that Ts already killed the hostages, and now it's just a duel :nuts:

Thus, I needed several dead bodies. Here's what I did:

I took the standard CS hostage model and decompiled it with MilkShape3D (even unregistered version does all this). First don't forget to copy all hostage*.mdl files a separate folder before decompiling, because it creates a bunch of files ;) Then in MilkShape, use Tools -> Half-Life -> Decompile normal MDL file and choose hostage.mdl as a source. Here hostage.mdl is a master model, so don?t forget to copy all the hostage01.mdl, hostage02.mdl, etc. However, you decompile only hostage.mdl, others are decompiled automatically.

I've got tons of various SMDs (separate models for each movement) and a QC file, which is a kind of compilation directive script.

I wanted to create two dead bodies in different positions, so I've copied hostage.qc to deadbody1.qc and deadbody3.qc.

After I edited each QC file. To do so, in MilkShape choose Tools -> Half-Life -> Edit QC file, or use any text editor like Notepad.

First, in each QC file you have to change the resulting model name to let MilkShape saving the result with a good filename. So, in the very first line of each QC file you will have something like --
$modelname "D:MymapModelsDeadBodyhostage.mdl"
In this line, I've changed hostage.mdl to deadbody1.mdl and deadbody3.mdl for each appropriate QC file.

Now, you have to remove all unwanted animation from the model and keep only the one-frame dead pose. To do so, in each QC file you keep all the rest untouched except the sequences section (the big list in the end). This list initially starts with a comment like --
// 129 sequences

For the deadbody1.qc, I've deleted EVERYTHING after this line except --
$sequence lying_on_back "lying_on_back" fps 30
-- and I've changed fps to 0, because there is no animation anyway.

For the deadbody3.qc, I've kept just --
$sequence dead_sitting "dead_sitting" fps 30
-- and I've changed fps to 0 again.

After choose Tools -> Half-Life -> Compile QC file to compile each file. If you did no mistakes, you'll get appropriate MDL files useable with the cycler_sprite entity.

This is what I did. Then I put my pretty dead workers to the map and added some blood decals for a touch of realism :) Here's the screenshots:
User posted image
Then you can change the skins of your models using HLModelViewer if you want. I think I will do that despite I'm happy with their worker cloths, because I would add some blood stains on the bodies themselves (decals cannot stain models, only brushes).

Also don't forget to place several CLIP brushes inside the bodies, otherwise players will just walk through these ghosts...

Comments

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