Animate command Problems?

Blitz3D Forums/Blitz3D Programming/Animate command Problems?

YellBellzDotCom(Posted 2006) [#1]
I made a similiar post in the beginners area, but this seems to be a major issue for me.

I load my .b3d model with an idle animation using LoadAnimMesh()

I then load a .b3d model with a walk animation using LoadAnimSeq()

I dont intialize any animation before the main loop so when the game loads, the model is not animating.

This code works. When I press the right bracket, the idle animation runs, if I press the right bracket again, the walk animation runs.
	If KeyHit(27)
		If Walk = 0 
			Animate mesh_3ds,1,1,1
			Walk = 1
		ElseIf Walk = 1 
			Animate mesh_3ds,1,.5,0
			Walk = 0
		EndIf
			
	EndIf
	
	;If Walk = 1 Then Animate mesh_3ds,1,1,1
	;If Walk = 0 Then Animate mesh_3ds,1,.5,0


Now if I uncomment the lower if statements, and comment out the animate commands in the keyhit(27) if statement like This...
	If KeyHit(27)
		If Walk = 0 
			;Animate mesh_3ds,1,1,1
			Walk = 1
		ElseIf Walk = 1 
			;Animate mesh_3ds,1,.5,0
			Walk = 0
		EndIf
			
	EndIf
	
	If Walk = 1 Then Animate mesh_3ds,1,1,1
	If Walk = 0 Then Animate mesh_3ds,1,.5,0

The model changes animations, the text output shows the animation loads correctly and that the model is animating with Animating(), but the model is not running any animations! The model changes to the first frame of each animation sequence, but thats it.

I cant understand how the animations work properly using the top code, but changing it to the bottom code gives me problems.

Any help would be greatly appreciated!


YellBellzDotCom(Posted 2006) [#2]
Ok, after a day and a half this makes sense, lol. Im setting Walk to 1 and reloading the animation with every screen flip. I need to check if the animation is already running, if it is, ignore the animate command. My preliminary corrections have made the 2nd block of code work.

I apologize for the obvious here, hehehehe.


xmlspy(Posted 2006) [#3]
http://www.alldevs.com/blitz/userlibs/animsys.html
Might help.


YellBellzDotCom(Posted 2006) [#4]
Looks like its fer a single animated mesh. I havent combined my animations into 1 file. The integrated Animate seems to be working excellant now. Thanks for the reference though!


jhocking(Posted 2006) [#5]
don't cross-post