Awesome help Captain P, thank you! Saved me many hours of faffing with it. Super helpful
Also thank you for linking the barney.cpp. I was looking for this file too and had no luck.
The code in the end was as follows.
For adding the skins to Barney, you edit barney.qc with the following:
$texturegroup "skinfamilies"
{
{ "barney_body.bmp" "barney_legs.bmp" "barney_chrome.bmp" "w_beretta.bmp" }
{ "barney_body2.bmp" "barney_legs2.bmp" "barney_chrome2.bmp" "w_beretta2.bmp" }
}
This is added after the "body" entries for the gun and the "studio" body model. It is essential that there is a space between the {} brackets and the "model.bmp" entries on each side - otherwise compile fails.
The first line of the array specifies the default bitmaps used for the skin, the second line specifies the custom ones for the second skin and so on.
After adding the model to the mod subfolder, you edit your custom FGD for the mod as follows:
@PointClass base(Monster,TalkMonster, Sequence) size(-16 -16 0, 16 16 72) studio("models/barney.mdl") = monster_barney : "Barney"
[
skin(Choices) : "Skin" : 0 =
[
0 : "Barney"
1 : "Watson"
]
]
The labels can be whatever you want obviously, here they are used to specify either Default Barney or the custom character "Watson".
This same addition can be performed to "monster_barney_dead" in order to allow you to use the custom skin for Barney corpses in Hammer as well.
Result in game:
Barney Skins Dead Barney Skins The only thing I'm trying to work out now is how the "monster_barney_dead" entity specifies the model sequence for the corpse. Like...how "lying_on_back" sequence is tied to the "Lying on back" FGD parameter for "pose". Because it's not specified in the model .qc. Perhaps it's in the entity .CPP code.Actually scratch that, turns out these values are specified in barney.cpp. So duplicating that .cpp for a custom NPC with the names of new animations would theoretically work. Sweet
Right now I use a non-solid monster_generic set to a scripted idle "dead" animation for custom dead animations, which is more clumsy.
Technically you could actually get around this in Hammer just by having a func_breakable over the corpse that triggers a gibshooter and killtarget on the monster_generic, but as far as I know func_breakables cannot be non-solid, so this might get in the way of gameplay.