Open noodlecollie opened 5 years ago
Hi.
Sorry for long answer, I was quite busy.
r_studio_lerping
is just an extension and mostly left for debugging purposes. I recommend to not change this value.
Also, old engine may sometimes handle view model incorrectly(due to unfinished weapon predicting). You may try to backport some features and fixes from new engine.
Which repo is the new engine?
I found in my own fork that the animation events for my weapon view model would be ignored unless I'd previously fired the weapon. I tracked this down to
R_StudioEstimateFrame()
stubbornly returning 0 when called fromR_StudioClientEvents()
, which would essentially act as though the animation was not playing.I established that there were in theory only two things that should affect the return value of
R_StudioEstimateFrame()
in this way: one would be if thecl_entity_t
'scurstate.frame
was 0, and the other was ifm_fDoInterp
was false. From experimentation it appears thatcurstate.frame
is actually always 0, even in cases where events are fired as they should be (I'm not sure if this is expected behaviour or not?). However, ifm_flDoInterp
is true then the returned value is interpolated (I'm assuming) accurately.It appears that
m_fDoInterp
remains true after the first time the weapon has been fired, so subsequent animation events are fired properly. However, to me this doesn't feel like intended behaviour.m_fDoInterp
is set inR_DrawStudioModelInternal()
according to the value ofr_studio_lerping
; in theory it is always set to true if that function is drawing the current view model, but I was able to reproduce my original bug where animation events did not fire if I setr_studio_lerping
to 0. If you do this and attempt to fire the Glock, for example, the muzzle flash will show forever (since it's played on animation frame 0) and reloading will not produce any sound.What's the best way to fix this? Should
curstate.frame
be updated properly?