Problem with Weapon Animations

Praz

Newbie
Joined
Aug 3, 2005
Messages
142
Reaction score
0
Hi,

I am trying to add 2 animations for an iron-sight effect (going into iron-sight mode, and going back to normal mode) in multiplayer hl2dm. So I start by looking in the model's .qc file and find:

$sequence toiron "toiron" ACT_VM_TOIRON 1 snap fps 30.00
$sequence tonormal "tonormal" ACT_VM_TONORMAL 1 snap fps 30.00

Then I added them to the enum list in ai_activity.h (tried these both ways):

ACT_VM_TOIRON,
ACT_VM_TONORMAL,
ACT_VM_TOIRON_FN2000,
ACT_VM_TONORMAL_FN2000,

Then in activitylist.cpp I added:

REGISTER_SHARED_ACTIVITY ( ACT_VM_TOIRON );
REGISTER_SHARED_ACTIVITY ( ACT_VM_TONORMAL );

Then I added to the acttable_t in the weapon source file (modified weapon_smg1.cpp)

{ ACT_HL2MP_JUMP, ACT_HL2MP_JUMP_SMG1, false },
{ ACT_RANGE_ATTACK1, ACT_RANGE_ATTACK_SMG1, false },
{ ACT_VM_TOIRON, ACT_VM_TOIRON_FN2000, false },
{ ACT_VM_TONORMAL, ACT_VM_TONORMAL_FN2000, false },

I also made a toggle so I could see the animations in action, and indeed the animation played on the toggle. But when I tried firing and nothing happened. I was able to drop the weapon and pick it up again, switch to other weapons without crashing, just could not fire.

After commenting out the code that actually plays the animation, the weapon still would not fire. So something is being registered wrong with the engine, as the above changes are all that were made and it still is not firing. Any ideas?
 
Praz said:
After commenting out the code that actually plays the animation, the weapon still would not fire. So something is being registered wrong with the engine, as the above changes are all that were made and it still is not firing. Any ideas?

I'd assume that the firing code relies on the animation being IDLE, instead of TOIRON. Try looking at the shooting code.

-Angry Lawyer
 
Angry Lawyer said:
I'd assume that the firing code relies on the animation being IDLE, instead of TOIRON. Try looking at the shooting code.

-Angry Lawyer


The code to play the animation "this->SendWeaponAnim( ACT_VM_TONORMAL )" is commented out, there is no place in the code where the animation is even getting called, that is why I am confused because it is breaking the other animations by not registering properly (I am not even attempting to play the animation as stated above).
 
if you get this working that would be really kool. wouldnt it have to be like a whole new stance like walking and crouching as it would control the speed you walk at and play a new walkin animation n everything?
 
Post the QC, alongside the QC for a gun that works. I could probably pick out where you've gone wrong.

-Angry Lawyer
 
Angry Lawyer said:
Post the QC, alongside the QC for a gun that works. I could probably pick out where you've gone wrong.

-Angry Lawyer

Code:
$cd "C:\Documents and Settings\Owner\My Documents\Model stuff\Incoming_Mod\F2000\compile\1"
$modelname "weapons\v_F2000.mdl"
$model "studio" "reference.smd"
$cdmaterials "models\weapons\V_models\F2000\"
$cdmaterials "models\weapons\v_models\hands\"
$hboxset "default"
// Model uses material "f2kmap.vmt"
// Model uses material "v_hands.vmt"
$attachment "1" "Body" -0.20 0.50 11.50 rotate 0 0 0
$attachment "2" "Body" -0.80 0.80 6.50 rotate -20 -165 0
$surfaceprop "default"
$illumposition 8.150 4.341 -7.773

$sequence idle "idle" ACT_VM_IDLE 1 snap fps 30.00

$sequence shoot "shoot" ACT_VM_PRIMARYATTACK 1 snap fps 30.00 {
  { event 5001 0 "1" }
  { event AE_CLIENT_EFFECT_ATTACH 0 "EjectBrass_762Nato 2 150" }
}

$sequence draw "draw" ACT_VM_DRAW 1 snap fps 30.00

$sequence holster "holster" ACT_VM_HOLSTER 1 snap fps 30.00

$sequence reload "reload" ACT_VM_RELOAD 1 snap fps 30.00 {
  { event 5004 10 "Weapon_AUG.Boltpull" }
  { event 5004 50 "Weapon_AUG.Clipout" }
}

$sequence toiron "toiron" ACT_VM_TOIRON 1 snap fps 30.00

$sequence tonormal "tonormal" ACT_VM_TONORMAL 1 snap fps 30.00

- using the above QC file, the weapon worked just fine
- attempting to register the animation in the activity list (see original post), caused the attack to become broke.

There are 2 not different QC files, because same QC file is used for the working and non-working versions.
 
Back
Top