Animation code problem

Blitz3D Forums/Blitz3D Beginners Area/Animation code problem

Cubed Inc.(Posted 2011) [#1]
Recently I have been working on a program with blitz3d that lets me test out the characters animations, aswell as acting like a model viewer.

I was working on setting up the debug functions of the game. So far you can rotate the character and see his running animation (the model is kirby from ssbm by the way) and I was working on making it so that you can change kirby's animations such as him running,standing or jumping by pressing the number keys.

I tried to code it so that kirby would switch to his standing stance when the 1 key is pressed but the code doesn't seem to be working. I've tried several different ways to make it work in it has done me no justice.

Could someone take a look at my code and tell me why kirby's animations aren't changing when the the 1 key is pressed?



Last edited 2011


Warner(Posted 2011) [#2]
You are only setting variables:
If KeyHit(2) = True Then animbeg%=25 And animfin%=44

And not calling 'Animate' again.
If KeyHit(2) = True Then animbeg%=25: animfin%=44: Animate TEST_MODEL1,animtype,animspeed,trans,10



Kryzon(Posted 2011) [#3]
No, I think the problem is that he only registered the sequence once:
ExtractAnimSeq TEST_MODEL1,animbeg,animfin
This 'creates' a sequence from 'animbeg' to 'animfin'; changing these variables won't affect the sequence since it's already been extracted, it's not dynamic.

You only control the real-time sequence range when using MD2's. With B3D's you need to extract all different sequences you are going to use throughout your program and use them appropriately.


Cubed Inc.(Posted 2011) [#4]
warner
I actually found out the problem. I was trying to play animations that were not extracted yet. I had to extract the sequences before I could play them properly.


Now pressing keys 1 2 and 3 makes kirby run,stand and jump.

thanks for the help though:)

Last edited 2011