How to make actions such as "die" "pain"

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
wxj
Posts: 5
Joined: Fri Nov 28, 2008 1:36 pm
Location: China

How to make actions such as "die" "pain"

Post by wxj »

I've used setMD2Animation(EMAT_DEATH_FALLBACK)/setMD2Animation(EMAT_PAIN_B) to make it,
but the model would do that again and again.
Then I used setLoopMode(false) and it would do it once, but it ended with the begin frame. The model I used is "sydney".
How can I make it?
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Well, I can see it happening, but I don't know enough about MD2 to know if it's a feature or a bug. I've added a case to the test suite which tentatively verifies the current behaviour.

What's causing it is this line in CAnimatedMeshMD2.cpp

Code: Select all

	// correct to anim between last->first frame
	outEnd += MD2_FRAME_SHIFT == 0 ? 1 : ( 1 << MD2_FRAME_SHIFT ) - 1;
We're adding 3 to the end frame. Without doing that, Sydney stays lying on the ground.

Standing her back up may be deliberate though, to segue into another animation. Animation's not really my thing, I'm just diagnosing it.

[UPDATE] I'll move this to the bugs section so that it doesn't get scrolled off the page, but I really don't know if it is a bug or not.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
wxj
Posts: 5
Joined: Fri Nov 28, 2008 1:36 pm
Location: China

Post by wxj »

Well, nice to see you again :lol:
Thanks for your attention and I've solved it with an imperfect solution.
I seted two variables to mark the start time and the time it would last,
then check them in while(device->run){}.
If current action ends, change Sydney's behaviour or use setCurrentFrame() to keep it lying on the ground.
I've wasted a lot of time on finding the last frame but it was still incoherence :roll:
Post Reply