View Single Post
Old 23-07-19, 21:26   #517
AkyV
Moderator
 
Joined: Dec 2011
Posts: 4,881
Default

Hello!
In my WIP plugin I try to reproduce the AOD walking mode feature. (Short SHIFT = turns it on/off.)
It goes well, but after I started working on the customizable details then there is a tiny detail I can't solve.

What I want for a specific flag, is:
- Up arrow: walk forward without SHIFT
- Standing still: walking mode "on" is kept
- Down arrow: not stepping back, but hopping back, the walking mode turns off by itself.

A simply "if animation is stepping back, then turn off the walking mode" condition is not enough here, Lara will not abort the animation:
- First "Down arrow without SHIFT": it will be a step back everyway - though, the walking mode surely turns off meanwhile.
- Second "Down arrow without SHIFT": now, as I wanted, it will be a hop back.

So I tried to force an animation:

The first animation of stepping back is 41.
The first animation of hopping back is 88.

It looks simple, eg. this way (still needs to be narrowed to "only when the walking mode is on", but that is not my actual issue now):

Code:
			Get (enumGET.LARA, 0, 0);
			if (GET.pLara->AnimationNow == 41) {				
			    GET.pLara->AnimationNow = 88;
			}
The problem is (even if I also try to force State, First Frame etc., it doesn't really matter, even for an "if anim is 88" condition) a huge Speed is generated now that makes Lara making a huge horizontal "jump".

The diagnostic always tells speeds about -32000 and such now. Speed is a "short" value, so I suspect this false speed must be a huge value above 32767, which cannot be presented in "short", that is why it is turned to a negative value.

Anim41 has speed 2.
Anim88 has speed 0.

I suspected that the animation-forcing makes that Speed 2 something really huge, that is why I tried this primitive troubleshooting code (bravely, even out of animation conditions, thinking that speed is never negative under normal circumstances):

Code:
	Get (enumGET.LARA, 0, 0);
	if (GET.pLara->SpeedH < 0) GET.pLara->SpeedH = 0;
But it also failed, no (real) effect, negative huge speed does not seem overwriteable...

Any idea?

Last edited by AkyV; 23-07-19 at 21:27.
AkyV is online now   Reply With Quote