Animate should be enhanced

Blitz3D Forums/Blitz3D Programming/Animate should be enhanced

xMicky(Posted 2004) [#1]
For many situations during a game it would make animated entities more flexible and more alive, if one could switch seamless between Animate and SetAnimTime. Think also of a games start: you load 10 identical walking Entities, but using Animate make them all walk in a stupid way synchronously.

While it is easy to switch from Animate to SetAnimTime:
Animate entHandle, 2
; some code..
curtime# =AnimTime#(entHandle)
Animate entHandle, 0
SetAnimTime entHandle, curtime#
; go on later with changings through SetAnimTime...

the reverse way is not possible without a visual break in the animation, because the execution of Animate always resets the mesh to frame 0 (or better: to Animtime =0) of the selected sequence. So I would like to have another parameter in Animate: startingTime#.


xMicky(Posted 2004) [#2]
OK, I just got this idea to switch from SetAnimTime to Animate without a break in the animation:

Function Switch2Animate(meshHandle, startingTime#)

Animate meshHandle, 2
While AnimTime#(meshHandle) <startingTime#
UpdateWorld
Wend

Return

End Function

but it seems neither efficient nor elegant to me to update the whole level just to set one mesh right, so I would like to insist to the suggestion above.


thefoxsoft(Posted 2004) [#3]
so does anyone knows a solution for this problem?
thanks in advance


sswift(Posted 2004) [#4]
They shouldn't all walk together unless you make them all start the walking animation at the exact same time.

Also, I wouldn't use animate myself. I would use animtime and set the frame manually, because that allows you to slow down or speed up the animation depending on the walk speed, which also adds more variation to the movements of the characters. YOu'd also want to vary how fast each character runs.