View Single Post
Old 24-07-19, 21:59   #521
Join Date: May 2010
Posts: 1,151

I understood this description, however I still think that it would be easier to check for the down key (even as scancode if not by game command), rather than trying to force specific animation parameters on animation 88.
The speed value stored by engine for animations is indeed strange and is converted by some complex formula to the SpeedH value we know, so it might not be worth the trouble to go this path...

I suspect that the problem with your current approach is that the walk mode is still engaged briefly (I'm guessing for just a single frame, but even this single frame is troublesome) after the game receives the Down command. As a result the game executes the walk back stateID and Lara initially does the stepping back animation instead of the hop. This is why, for your goal, I do not recommend checking for anim 41 (stepping back), because even if this does result in turning off the walk mode, it is done post-factum, when anim 41 has already been triggered due to the 1 frame delay I mentioned.

Remember that in the end the game works in frame cycles. Once game code has already been executed for one particular frame cycle, it cannot be always retroactively fixed in a later part of that cycle, and when that happens the change can take effect only in next cycle. In this case specifically, the condition for anim 41 asserts that the animation is already executed by game, and thus despite walk mode getting turned off even in the first frame, the animation continues, as it can only stop when reaching a state change. This would explain why the second down key press works fine - the walk mode had already been disabled by this time, thus the hopping back animation is launched instead.

I have strong confidence that detecting the down key press (optionally with additional checks for relevant stateIDs) will allow you to disable the 'walk mode' before game gets chance to launch the "walking back" stateID and animation.

Last edited by Krystian; 24-07-19 at 22:10.
Krystian is offline   Reply With Quote