Weird view model animation bug

  • Thread starter Thread starter Darius
  • Start date Start date
D

Darius

Guest
I dont know if anyone else out there is experiencing this bug, but I'm making a HL2 multiplayer mod and I'm working on the shotgun weapon now and there are times when the shoot animation simply does not play. It's kinda rare but it seems to happen during situations where the FPS is kinda low.
Anyone else seeing this phenomenon?
 
Finally solved this annoying problem where the view model animations would not play due to a prediction error. To recreate this error, set your "net_fakeloss 30" and switch to the basic shotgun (in the SDK mod) and keep shooting. Sometimes, the shoot animation simply does not play... This has driven me mad for weeks now and I finally tracked the bug.

It's related to the 'm_flAnimTime' network variable. It's not being predicted properly in the SDK code. So if you make the following changes, it should work.

- Open up "baseviewmodel_shared.cpp"
- Find the line that says
DEFINE_PRED_FIELD( m_flAnimTime, FIELD_FLOAT, 0 ),

- Change it to
DEFINE_PRED_FIELD( m_flAnimTime, FIELD_FLOAT, FTYPEDESC_PRIVATE ),

- compile the code

I tested it and it seems to work fine without any side effects. If anyone else notices any side effects of the following code change, pls let me know. Thanks
 
Hmm, I experienced similar weird behavior with viewmodels but don't know if it's related. I'll make the change in our mod and see if I notice the difference.

Thanks for posting the solution of your own problem.
 
yeah ive had that recently with valve model and valve animation. not when the fps was low though. i assumed it was something wrong with my code. as it was in third person perspective.
 
Back
Top