Recompiling a model for the crowbar?

So I’ve never really worked with decompiling/reskinning models for Source, and I’ve been wondering how I’d go about recompiling a model for the HL2 crowbar; I have looked around, but haven’t seemed to find a guide that explains exactly what I’m looking for. I’m trying to use the umbrella from Fortress Forever on the default HL2 crowbar animations, is there a way to do this? Forgive my complete ignorance :v:

Nobody’s responded yet so I guess it’s okay to bump this? With a little bit of work, I managed to get the umbrella in place of the crowbar, but it still has the Fortress Forever viewmodel hands. Can anyone either tell me how I’d go about getting rid of the hands so I can use custom ones on it, or would anyone be willing to do it for me?

  1. It’s actually pretty early to bump this, so consider waiting a few days before bumping next time. From what I’ve observed over my time here, the common rule of thumb seems to be wait anywhere between 2 or 3 days to a week before bumping your own thread. It doesn’t guarantee that your request will pick up on activity, but it doesn’t seem to annoy people as much.

  2. If the umbrella model were to just be replacing the crowbar model without swapping the arms out and just using the default HL2 crowbar animations as well, then it would be a rather simple swap that would only require replacing the crowbar model with the umbrella and assigning the umbrella model to the correct bones. However, since you’re wanting to have the viewmodel hands that are associated with the umbrella model as well, the arms would probably have to be re-rigged in the reference file before you could actually re-compile everything to replace the default crowbar model.

Sorry about the early bump, I’ll remember that next time. The thing is, I technically have it working but the viewmodel still has the Fortress Forever hands attached to it, which I don’t want.

In that case, you need to separate the umbrella model from the Fortress Forever hands (which can be done by simply deleting the arms and hands so that only the umbrella remains). After doing that (and assuming you already have the umbrella model replacing the crowbar in your reference file), make sure the umbrella itself is assigned to the appropriate bones and export it as your new reference file for the .QC to read. Compile it afterwards, and you should have the desired results.

Unfortunately, I’m still a bit of a newbie at this. How exactly would I go about deleting the arms and hands, assigning the correct bones and exporting it?

It depends on which program you use, but the method for deleting the arms is generally similar between each one. For what I normally use though, the steps involved will require a program called Milkshape 3D (which you can grab a copy of here). I usually use Milkshape 3D for simple model swaps like this (most people advise starting out with 3DS Max instead, which I do agree is a far better program to learn, but I’ve found this one to be a bit easier to start out with for people who aren’t exactly familiar with working on anything meant for the Source engine at first), so I’ll get you started off with the process you’d follow with that program.

To get started, you’ll first need to import the references for the HL2 arms and crowbar, and the Fortress Forever arms and umbrella (which can be done by going to File, looking at the Import list, and then clicking on Half-Life .SMD); since you’re wanting to make this a simple model swap for HL2’s crowbar, make sure that you do the following:

  1. Import the HL2 crowbar’s view model reference file (which can be done by going to File, then hovering your mouse over Import, and then clicking on the Half-Life .SMD option in the list) first with the following settings:

  1. Next, import the reference file for the Fortress Forever umbrella’s view model in the same manner as you did for the HL2 crowbar view model reference, but untick the skeleton option for the import settings. This will allow the Fortress Forever umbrella and arms to be imported, but it will not include the rigging from that reference file.

  2. To delete the Fortress Forever arms associated with the umbrella, go to the Groups tab (which contains each model group for the reference file), double-click the model group for the Fortress Forever arms (which should have a rather simple name like ‘v_hands’; HL2’s default hands model is labeled as v_hand_sheet, so any variation of that can be removed), and then hit the delete key on your keyboard. This will delete the Fortress Forever arms from the reference, thus allowing you to avoid having to re-rig the arms.

  3. Next, you’ll want to delete the crowbar itself (which is split into two parts in the Groups tab, labeled as crowbar_cyl for the lengthy part of the crowbar and head_uvw respectively), which can be done in the same manner as you did for the Fortress Forever arms. If done correctly, you should have the HL2 arm model (and its rigging) and the Fortress Forever umbrella model left to work with.

Assigning the model to the correct bone, or ‘joint’ in the case of Milkshape 3D (they’re referred to as joints in Milkshape 3D for some odd reason) would just require finding the correct bone under the joints tab (which I believe would be ValveBiped.Bip01_R_Hand) and double-clicking it in the list, then selecting the umbrella model in the groups tab by holding down Shift on your keyboard and double-clicking on it as well. After both are selected (indicated by your selections being red), you’d then go back to the joints tab and click on the button labeled ‘Assign’. The model will now be assigned to the correct bone/joint for the view model, and you can then export it (File > Export > Half-Life .SMD) as your reference file. Now, being that this is a view model, you can easily leave your .SMD export settings as follows since it doesn’t really seem to make a difference either way when using Milkshape 3D:

After doing this, all you’d really need to do from here is just modify your .QC as necessary to make the appropriate adjustments as required, place the .VMT and .VTF files in the appropriate locations, and then modify your .VMT files so that they look for the associated .VTF files in the appropriate location (which can be done with programs like Notepad, Notepad++, or VTFEdit). Compile the view model, and you should have a working setup from that point forward.

-snip-

[editline]7th March 2015[/editline]

Everything’s worked fine so far, except that when I go to select ValveBiped.Bip01_R_Hand in the Joints tab it refuses to select. The umbrella selects fine, which is odd.

You have to double-click on the bone in order to select it, and then double-click on the umbrella model in the Groups tab while holding down the Shift key on your keyboard. Milkshape 3D is a bit finicky when it comes to bone and model group selection at times, as it will sometimes not recognize that you’re selecting multiple things if you don’t hold down the Shift key while selecting other things after already having one selection made. However, sometimes the model itself will be hiding the bone from view, so you may need to zoom in a bit in one of the editing fields to see that the bone is selected.

Yeah I did double-click on both, the problem is the hand bone won’t select at all, or at least doesn’t seem to.

[editline]7th March 2015[/editline]

Well, now I’ve done everything you said, but the viewmodel is invisible ingame.

Try adding rotate -90 or rotate 90 to each of the $sequence lines in your .QC file. For an example of how to apply it to the .QC file, here’s one of the sequence lines from an old skin I was working on:


$sequence draw "draw" ACT_VM_DRAW 1 snap rotate -90 fps 32.00 {
  { event 5004 0 "Weapon_M16A4.ClothMovement" }
  { event 5004 1 "Weapon_M16A4.ClothMovement4" }
}

If rotate -90/90 doesn’t work, try using rotate 180 instead.

None of those seem to work. My .QC file looks set up a little differently though, here’s an example:


$sequence "HitCenter1" "v_umbrella_anims\HitCenter1.smd" {
	snap rotate 180
	fps 30
	activity "ACT_VM_HITCENTER" 1
	fadein 0
	fadeout 0
}

Considering how your .QC is structured for the sequences, you may want to try this instead:


$sequence "HitCenter1" "v_umbrella_anims\HitCenter1.smd" {
	snap
	rotate <insert one of afformentioned numbers (90, -90, or 180) here>
	fps 30
	activity "ACT_VM_HITCENTER" 1
	fadein 0
	fadeout 0
}

Still nothing. At this point I’m beginning to wonder if I should just give up, because I’ve tried everything I can possibly think of and it’s still invisible.

And leaving the rotate command out of there entirely also still yields the invisible view model?

Yep. I don’t think I’m missing anything, because I followed your instructions to the letter.

In that case, the animations themselves might actually be broken; this isn’t your fault at all, it’s actually related to how the original version was compiled and how the decompiler ends up handling it as a result. If you don’t mind, would you please copy the contents of your .QC and paste them here? I’d like to take a look at it real quick for a possible workaround that may fix your problem. Make sure to use the [noparse]




[/noparse] tags so that it doesn’t take up the whole page.

Sure thing, here you go:


// Created by Crowbar 0.24.0.0

$modelname "weapons/umbrella/v_umbrella.mdl"

$bodygroup "studio"
{
	studio "v_umbrella_reference.smd"
}


$cdmaterials "models\weapons\umbrella\"
$cdmaterials "models\Weapons\V_hand\"


$surfaceprop "default"

$contents "solid"


// NOTE: The following commented-out $definebone lines might be needed, as is often the case for view models. When needed, simply remove the two slashes '//' from the start of each line.
// $definebone "ValveBiped.Bip01" "" -0.000005 -0.533615 38.566917 1.570796 0 0 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_Spine" "ValveBiped.Bip01" 0.000005 3.345128 -2.981-1801 1.570796 0.086293 1.570796 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_Spine1" "ValveBiped.Bip01_Spine" 4.018331 0 0 0 0 -0.029242 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_Spine2" "ValveBiped.Bip01_Spine1" 3.518565 0 0 0 0 0.100336 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_Spine4" "ValveBiped.Bip01_Spine2" 8.942642 0 0 0 0 0.194096 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Clavicle" "ValveBiped.Bip01_Spine4" 2.033346 1.000768 1.93766 1.596637 -1.286515 2.942961 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_UpperArm" "ValveBiped.Bip01_L_Clavicle" 6.028142 0.000001 0 -1.579613 0.047802 -0.585173 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Forearm" "ValveBiped.Bip01_L_UpperArm" 11.692555 0 0.000001 0 0 -0.060372 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Hand" "ValveBiped.Bip01_L_Forearm" 11.481672 0 -0.000031 1.573183 -0.106613 0.044193 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger4" "ValveBiped.Bip01_L_Hand" 3.859704 -0.142406 -1.191974 -0.468133 0.151533 -0.880197 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger41" "ValveBiped.Bip01_L_Finger4" 1.312562 0.000001 0.000001 0 0 -0.43972 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger42" "ValveBiped.Bip01_L_Finger41" 0.729366 0.000001 0.000001 0 0 -0.244299 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger3" "ValveBiped.Bip01_L_Hand" 3.942326 0.046772 -0.431443 -0.15178 0.073206 -0.810985 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger31" "ValveBiped.Bip01_L_Finger3" 1.53-18096 -0.000001 0 0 0 -0.247797 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger32" "ValveBiped.Bip01_L_Finger31" 1.196324 0.000001 0 0 0 -0.430802 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger2" "ValveBiped.Bip01_L_Hand" 3.883687 -0.046769 0.431443 0.085-1802 0.02183 -0.587867 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger21" "ValveBiped.Bip01_L_Finger2" 1.719575 0 0 0 0.005516 -0.366478 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger22" "ValveBiped.Bip01_L_Finger21" 1.209183 0 0 0 0.003084 -0.2164 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger1" "ValveBiped.Bip01_L_Hand" 3.85986 -0.137948 1.332466 0.354449 -0.04275 -0.531718 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger11" "ValveBiped.Bip01_L_Finger1" 1.719429 0 0 0 0.004074 -0.363009 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger12" "ValveBiped.Bip01_L_Finger11" 1.099667 0 0 0 0.002596 -0.244331 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger0" "ValveBiped.Bip01_L_Hand" 0.806047 -0.348923 1.321258 -1.222677 -0.679213 -0.788819 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger01" "ValveBiped.Bip01_L_Finger0" 1.789783 0 0 0 0 0.228523 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_L_Finger02" "ValveBiped.Bip01_L_Finger01" 1.206999 0.000001 0 0 0 0.36286 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Clavicle" "ValveBiped.Bip01_Spine4" 2.033353 1.000771 -1.93761 -1.668474 1.286518 2.942953 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_UpperArm" "ValveBiped.Bip01_R_Clavicle" 6.028143 0.000001 0 1.639479 -0.008065 -0.586846 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Forearm" "ValveBiped.Bip01_R_UpperArm" 11.692554 0 0.000001 0 0 -0.060372 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Hand" "ValveBiped.Bip01_R_Forearm" 11.481699 0 0.000003 -1.564936 0.106606 0.044193 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger4" "ValveBiped.Bip01_R_Hand" 3.859672 -0.132568 1.193108 0.466236 -0.158066 -0.878825 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger41" "ValveBiped.Bip01_R_Finger4" 1.31256 0 0 0 0 -0.439672 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger42" "ValveBiped.Bip01_R_Finger41" 0.729366 0.000001 -0.000001 0 0 -0.244271 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger3" "ValveBiped.Bip01_R_Hand" 3.942295 0.050324 0.431043 0.150078 -0.079191 -0.810205 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger31" "ValveBiped.Bip01_R_Finger3" 1.53-18097 -0.000001 0 0 0 -0.247771 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger32" "ValveBiped.Bip01_R_Finger31" 1.196323 0.000001 0 0 0 -0.430761 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger2" "ValveBiped.Bip01_R_Hand" 3.883656 -0.050329 -0.431043 -0.085-1805 -0.026404 -0.587695 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger21" "ValveBiped.Bip01_R_Finger2" 1.719577 0 0 0 -0.007974 -0.366436 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger22" "ValveBiped.Bip01_R_Finger21" 1.209183 -0.000001 0 0 -0.004461 -0.216376 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger1" "ValveBiped.Bip01_R_Hand" 3.859827 -0.148936 -1.331282 -0.354419 0.038567 -0.532001 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger11" "ValveBiped.Bip01_R_Finger1" 1.719426 -0.000002 0 0 -0.006613 -0.36297 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger12" "ValveBiped.Bip01_R_Finger11" 1.099664 0.000002 0.000001 0 -0.004211 -0.244312 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger0" "ValveBiped.Bip01_R_Hand" 0.806018 -0.359836 -1.318334 1.221409 0.673635 -0.793558 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger01" "ValveBiped.Bip01_R_Finger0" 1.789783 0 0 0 0 0.228555 0 0 0 0 0 0
// $definebone "ValveBiped.Bip01_R_Finger02" "ValveBiped.Bip01_R_Finger01" 1.206995 -0.000001 0 0 0 0.362-1805 0 0 0 0 0 0




$sequence "Draw" "v_umbrella_anims\Draw.smd" {
	fps 30
	activity "ACT_VM_DRAW" 1
	fadein 0
}

$sequence "Idle1" "v_umbrella_anims\Idle1.smd" {
	fps 30
	activity "ACT_VM_IDLE" 1
}

$sequence "Idle2" "v_umbrella_anims\Idle2.smd" {
	fps 30
	activity "ACT_VM_IDLE" 1
}

$sequence "Idle3" "v_umbrella_anims\Idle3.smd" {
	fps 30
	activity "ACT_VM_IDLE" 1
}

$sequence "MissCenter1" "v_umbrella_anims\MissCenter1.smd" {
	fps 30
	activity "ACT_VM_MISSCENTER" 1
	fadein 0
	fadeout 0
}

$sequence "MissCenter2" "v_umbrella_anims\MissCenter2.smd" {
	fps 30
	activity "ACT_VM_MISSCENTER" 1
	fadein 0
	fadeout 0
}

$sequence "MissCenter3" "v_umbrella_anims\MissCenter3.smd" {
	fps 30
	activity "ACT_VM_MISSCENTER" 1
	fadein 0
	fadeout 0
}

$sequence "HitCenter1" "v_umbrella_anims\HitCenter1.smd" {
	fps 30
	activity "ACT_VM_HITCENTER" 1
	fadein 0
	fadeout 0
}

$sequence "HitCenter2" "v_umbrella_anims\HitCenter2.smd" {
	fps 30
	activity "ACT_VM_HITCENTER" 1
	fadein 0
	fadeout 0
}

$sequence "HitCenter3" "v_umbrella_anims\HitCenter3.smd" {
	fps 30
	activity "ACT_VM_HITCENTER" 1
	fadein 0
	fadeout 0
}



The weird thing is, when I was just using the umbrella with the FF arms on the crowbar, it worked fine. It’s this whole process of removing the FF arm that’s messing with me.

After looking at your .QC here, I think an understanding may have gotten lost somewhere along the lines over this scenario. Just to clarify, are you trying to bring the Fortress Forever umbrella AND its animations over to Half-Life 2, or are you just taking the umbrella model itself (not its animations) and using that with the Half-Life 2 arms and animations in Half-Life 2?

Preferably just the umbrella model on the HL2 arms and anims in HL2, but if it’s easier to use the umbrella animations too I could do that?