reload animation ends earlier than its suppost to end Created 3 years ago2021-01-17 19:27:28 UTC by petergriffinxxxtentacion petergriffinxxxtentacion

Created 3 years ago2021-01-17 19:27:28 UTC by petergriffinxxxtentacion petergriffinxxxtentacion

Posted 3 years ago2021-01-17 19:27:28 UTC Post #345237
i am making a mod that improves hl1 gun animations, and i got a problem with the 357 reload animation that it ends around frame 71 instead of frame 87, i searched around the 357 gun codes and i can't find where i can make the animation end at the frame its suppost to end.

in-game reload animation

reload animation in half-life model viewer

any help would be appreciated
Posted 3 years ago2021-01-17 23:43:51 UTC Post #345238
I like the speedloader though
Posted 3 years ago2021-01-19 10:32:43 UTC Post #345250
I've taken a look at the 357 reloading code. Apart from a few events that can be specified in animations, much of the timing appears to be hard-coded. Ideally you'd want the code to react to the end of an animation, but I don't know enough about the HL engine to say whether that's possible.

CPython::Reload calls DefaultReload( 6, PYTHON_RELOAD, 2.0, bUseScope );, so the actual 'ammo transfer' happens after 2 seconds. Apparently that's when you can fire the weapon again, even if the reload animation hasn't finished yet.

DefaultReload also contains the line m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3;, which causes CPython::WeaponIdle to pick a new idle animation after 3 seconds, regardless of whether the reload animation has finished. CPython::WeaponIdle also contains hard-coded durations for each of the idle/fidget animations.
You must be logged in to post a response.