How to make a model explode when you shoot at it, like the soldiers in SiN.

Now i’m not sure if this is a .qc command or something else, but is there a way to make a model blow up if you shoot at it enough, like the antlion workers in Episode 2 or the soldiers in SiN Emergence, when they die, they explode. Is that a .qc command or coding? I don’t know and I need some help.

Hell I don’t even know if this is the right section.

Here’s the .qc for the explosive barrel.
It’s kinda like what you want.
But you’re talking about Gibbing NPCs…

What are you trying to make?

$modelname "props_bms\oildrum001_explosive.mdl"
$model "Body" "oildrum001_explosive_reference.smd"
$lod 30
  replacemodel "oildrum001_explosive_reference" "lod1_oildrum001_explosive_reference"
$cdmaterials "models\props_bms/"
$hboxset "default"
$hbox 0 "static_prop" -14.500  -14.500  -0.000  14.500  14.500  45.000
// Model uses material "Oil_Drum001h.vmt"
$surfaceprop "floating_metal_barrel"
$keyvalues  { prop_data { "dmg.bullets" "1.0" "" "1.0" "dmg.explosive" "1.0" "health" "20" "explosive_damage" "120" "explosive_radius" "256"  } physgun_interactions { "onfirstimpact" "break"  } fire_interactions { "flammable" "yes" "explosive_resist" "yes" "ignite" "halfhealth"  } } 
$illumposition 0.000 0.000 22.500
$sequence idle "idle" loop fps 5.00
$collisionmodel "phymodel.smd" {

	$mass 35.0
	$inertia 1.00
	$damping 0.00
	$rotdamping 0.00
$collisiontext {
	break { "model" "props_bms/oildrumchunk01a" "health" "10" "fadetime" "10" "burst" "100"}
	break { "model" "props_bms/oildrumchunk01b" "health" "10" "fadetime" "10" "burst" "100"}
	break { "model" "props_bms/oildrumchunk01c" "health" "10" "fadetime" "10" "burst" "100"}
	break { "model" "props_bms/oildrumchunk01d" "health" "10" "fadetime" "10" "burst" "100"}
	break { "model" "props_bms/oildrumchunk01e" "health" "10" "fadetime" "10" "burst" "100"}

Trying to make a model that if you shoot it a couple of times, it blows up…

Though I might post this in the LUA section cause I do want an NPC that does the same.

The soldiers in SiN were coded in the games code to do that, not through the model.

Aww, well, is it possible to do that through an SNPC?


Yes, but its very difficult. The best example would be the headcrab on the zombies. The zombie, the headcrab, and the zombie with the headcrab are technically all different models. And when the zombie dies ( under certain circumstances ) the headcrab is loaded where it should be. So instead of loading in a headcrab you could load in the different parts of the body, such as arms and legs and such. This would require a model for each part you want to blow off. Just like with the exploding barrel, the broken up parts are separate models.