Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Modifying NPC Gibs (npc_gib_model.txt)  (Read 91 times)

0 Members and 1 Guest are viewing this topic.

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Modifying NPC Gibs (npc_gib_model.txt)
« on: May 25, 2020, 04:00:46 PM »
NPC Gib Model Data

This file is located at: .../BSMOD/scripts/npc_gib_model.txt

Hey ever heard of gibs? You know the fleshy/pulpy bits that npc's explode into when you damage them enough? Or the glass shards that Dr. Magnusson explodes into because hes really just an empty vessel, a hollow husk of a human being devoid of an any substance or emotion, lacking any morals or feelings towards others? Yeah those things.

So BSMOD lets you change those with a text editor. Want to make combine explode into watermelons? You can do that. Have your own custom models that you want to pop out of Alyx when she tries to fondle a combine frag grenade? You can do that too.

Lets look at the default file for BSMOD:

Code: (npc_gib_model.txt) [Select]
//
// BSMOD gib model data
//
NPCGibModelData
{
"default_humans"
{
"5"
{
//"gib2" "models/gibs/hgibs01.mdl"
"gib2" "models/gibs/hgibs02.mdl"
"gib2" "models/gibs/hgibs03.mdl"
"gib2" "models/gibs/hgibs04.mdl"
"gib2" "models/gibs/hgibs06.mdl"
"gib2" "models/gibs/hgibs07.mdl"
"gib2" "models/gibs/hgibs08.mdl"
"sticky" "models/gibs/hgibs11.mdl"
"sticky" "models/gibs/hgibs09.mdl"
"sticky" "models/gibs/hgibs10.mdl"
"sticky" "models/gibs/hgibs05.mdl"
}
"10"
{
"raggib" "models/gibs/rgib_p1.mdl"
"raggib" "models/gibs/rgib_p2.mdl"
"raggib" "models/gibs/rgib_p3.mdl"
"raggib" "models/gibs/rgib_p4.mdl"
"raggib" "models/gibs/rgib_p5.mdl"
"raggib" "models/gibs/rgib_p6.mdl"
}
"15"
{
"raggib" "models/gibs/limbs/l4d2_torso1.mdl"
"raggib" "models/gibs/limbs/l4d2_larm1.mdl"
"raggib" "models/gibs/limbs/l4d2_rarm2.mdl"
"raggib" "models/gibs/limbs/l4d2_lleg1.mdl"
"raggib" "models/gibs/limbs/l4d2_rleg2.mdl"
}
"20"
{
"raggib" "models/gibs/limbs/l4d2_torso2.mdl"
"raggib" "models/gibs/limbs/l4d2_larm2.mdl"
"raggib" "models/gibs/limbs/l4d2_rarm1.mdl"
"raggib" "models/gibs/limbs/l4d2_rleg1.mdl"
"raggib" "models/gibs/limbs/l4d2_lleg2.mdl"
}
"25"
{
"raggib" "models/gibs/limbs/l4d2_torso3.mdl"
"raggib" "models/gibs/limbs/l4d_larm1.mdl"
"raggib" "models/gibs/limbs/l4d_lleg1.mdl"
"raggib" "models/gibs/limbs/l4d_rarm1.mdl"
"raggib" "models/gibs/limbs/l4d_rleg1.mdl"
"raggib" "models/gibs/limbs/l4d_head1.mdl"
}
}

"default_aliens"
{
"gib2" "models/gibs/agibs01.mdl"
"gib2" "models/gibs/agibs02.mdl"
"gib2" "models/gibs/agibs03.mdl"
"gib2" "models/gibs/agibs04.mdl"
}

"models"
{
"models/kleiner.mdl"
{
"gib2" "models/props_lab/monitor01a.mdl"
"gib2" "models/props_lab/cactus.mdl"
"gib2" "models/props_lab/clipboard.mdl"
"gib2" "models/props_lab/desklamp01.mdl"
"gib2" "models/props_lab/harddrive01.mdl"
"gib2" "models/props_lab/harddrive02.mdl"
"gib2" "models/props_lab/jar01a.mdl"
"gib2" "models/props_lab/jar01b.mdl"
"gib2" "models/props_lab/tpplug.mdl"
"gib2" "models/props_lab/binderblue.mdl"
"gib2" "models/props_lab/bindergreen.mdl"
"gib2" "models/props_lab/binderredlabel.mdl"
}
"models/magnusson.mdl"
{
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
}
"models/humans/charple01.mdl"
{
"gib2" "models/gibs/hgibs.mdl"
"gib2" "models/gibs/hgibs_rib.mdl"
"gib2" "models/gibs/hgibs_rib.mdl"
"gib2" "models/gibs/hgibs_rib.mdl"
"gib2" "models/gibs/hgibs_scapula.mdl"
"gib2" "models/gibs/hgibs_scapula.mdl"
"gib2" "models/gibs/hgibs_spine.mdl"
"gib2" "models/gibs/hgibs_spine.mdl"
"gib2" "models/gibs/hgibs_spine.mdl"
}
}
}



DEFAULT GIB GROUPS

Lets take a look at an example of a Default group first, the // are added by me and anything after them is a comment and would not be read by the engine:

Code: [Select]
"default_humans" //Defines which type of npcs to assign gibs to.
{
"5" //Percent Chance to Spawn these Gibs.
{
//"GibType" "path/to/model/file.mdl"
"gib2" "models/gibs/hgibs08.mdl"
"raggib" "models/gibs/rgib_p6.mdl"
"sticky" "models/gibs/hgibs11.mdl"
}

}

A default group lets you set gibs for an entire type of npc's.

In this example, "default_humans" will give these gib models to all human type npc's (npc_citizen, alyx, barney, etc.) Any gibs defined on a per model basis will override these default groups, so these are really just useful as a baseline.

Other groups are usually "default_aliens" which include vortigaunts and zombies and "default_combine" which probably include combine.


Inside of the "default_humans" group we have a Chance group, in this case "5". This is actually a percent chance to spawn a particular group of gibs. The 5 is probably a 5% chance to spawn the group of gibs inside its brackets. You can probably set this all the way to 100.

Inside of the chance group we finally get to our gib values:

Code: [Select]
"gibtype"   "modelpath"
"gibtype" defines what type of gib it will be. Gib2=standard gib; RagGib=gib with ragdoll properties; Sticky=gibs that stick to walls.
"modelpath" points to the model you want to use for the gib.

You can put as many gib values into a group as you like, just remember that having each NPC spawn 100 gibs when they die, can cripple performance and cause crashes. Use your best judgement.





MODEL GIB GROUPS

You can also set gibs on a per model basis. Setting gibs for a model will override their default_group.
Lets take a look at an example of a Model group first, the // are added by me and anything after them is a comment and would not be read by the engine:

Code: [Select]
"models"  //Place all model gib groups inside this section!
{
"models/kleiner.mdl"  //This is the model we want to define gibs for.
{
"gib2" "models/props_lab/monitor01a.mdl"
"gib2" "models/props_lab/cactus.mdl"
"gib2" "models/props_lab/clipboard.mdl"
"gib2" "models/props_lab/desklamp01.mdl"
"gib2" "models/props_lab/harddrive01.mdl"
}
"models/magnusson.mdl"  //This is the model we want to define gibs for.
{
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
}
}


This section should be pretty self explanatory.

"models/kleiner.mdl" = tells the game which model we want to add gibs for. This can be any npc model! In this example we would be adding gibs to the Dr.Kleiner model.

You can also put Chance Groups in each model group to provide a chance for certain gibs to spawn!

Code: (Example) [Select]
"models"
{
"models/magnusson.mdl"
{
// Can have CHANCE GROUPS per model.
"20"
{
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
"gib2" "models/props_junk/garbage_glassbottle003a.mdl"
}
"25"
{
"gib2" "models/props_lab/monitor01a.mdl"
"gib2" "models/props_lab/cactus.mdl"
"gib2" "models/props_lab/clipboard.mdl"
"gib2" "models/props_lab/desklamp01.mdl"
"gib2" "models/props_lab/harddrive01.mdl"
}
}
}


NOTE: I've attached a marked up copy of the npc_gib_model.txt
« Last Edit: May 25, 2020, 05:18:56 PM by BIZ »