I've got an irritating little problem with animation events repeating
(or doubling-up if you will) especially in view and weapon world
models. To be honest it's been around since I first started our mod on
the original HL2 SDK although we're currently using the HL2MP EP1 SDK
and it still remains.
The problem manifests itself most obviously as follows. A weapon world
model triggers a muzzle flash and shell eject via an event defined in
the QC as follows:
$sequence attack1 "attack1" ACT_RANGE_ATTACK_RIFLE 1 fps 20.00 {
{ event AE_NPC_MUZZLEFLASH 0 "SMG1 MUZZLE" }
{ event 3002 0 }
{ event 6001 0 "1" }
}
Model is compiled and works as expected when fired, i.e muzzle flash
on frame 0 and rifle style case is ejected. However about 2 seconds
after the weapon is fired, the muzzle flash, case eject or both repeat
again even though the player never fired. I did a debug/trace and
indeed C_BaseAnimating::FireEvent is being called a second time some
two seconds later from within C_BaseAnimating::DoAnimationEvents.
My best guess is that these events are being predicted and that the
server is trying to re-sync the event with the client and due to the
delay is making it get fired twice. I also noticed that a similar
effect seems to happen occasionally with view models, i.e. double
muzzle flash/shell cases. The events continue to double even if
cl_predict 0 is used and the effect seems to be worse on weapons where
the view model fire animation sequence is quite long, i.e. bolt rifles
that need to cycle the bolt rather than machine guns.
I trawled back through the hlcoders archive and noticed a few
discussions in a similar vein to this problem but none seem to have a
clear solution. I've set "UseClientSideAnimation()" in the client-side
constructor of my weapons class and I checked and my weapons are
predicted.
Can anyone shed any light on what may be causing doubling up of events
and how to get around it?
- Jed
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders