AnimSeq & AnimLength

Blitz3D Forums/Blitz3D Programming/AnimSeq & AnimLength

.rIKmAN.(Posted 2004) [#1]
I just had a quick play with these 2 commands and noticed that getting them to match up is very hit and miss.
If I want to wait until a certain sequence is finished before changing to another I`d use code such as (snippet)

If AnimTime(model) = AnimLength(model)
Animate model,1,.3,walk
Else
; Do nothing
Endif

The problem is that they *NEVER* match exactly, which means I have to change to something like:


If AnimLength(model) - AnimTime(model) < .5
Animate model,1,.3,walk
Else
; Do nothing
Endif

This causes jerkyness beyond belief tho, and this is pretty much the lowest I can go (0.5) without it missing totally and goin crazy.

Also I noticed that one of the Anim commands returns a float to 1dp, the other one to 4dp....is this something I¬m doing ( i set both vars to floats to store the result) or is it something to do with blitz.

Note: I have also tried using "If Animating" and while this is better, there is still a lot of jerkyness, and I am using a tween value of 10.

Thanks guys, any ideas?


Rob Farley(Posted 2004) [#2]
use int(animtime(mesh))


.rIKmAN.(Posted 2004) [#3]
There is still a noticable jump in the movement....am I missing something here, code/command-wise?


Rob Farley(Posted 2004) [#4]
Check the transition value

http://www.blitzbasic.com/b3ddocs/command.php?name=animate&ref=goto


.rIKmAN.(Posted 2004) [#5]
Yeah cheers Rob but I`ve played with these (not a n00b! :)).

I have also done this before with a decompiled CS model and it worked great, now though there just always seems to be a pause/stutter between changing animation frames.

As I`ve said using AnimLength and AnimTime to be precise fails cos of the inconsistency between the two return values - using in does match them up, but its still jumpy.

Hmmmm.


AntonyWells(Posted 2004) [#6]
I just animate and animating()

for idle amins, just loop them. for a jump, animate jump, blah, but set it one-shot anim, and then every frame us animating(entity) to see when it's finished, then go to the next anim, be idle or land or whatever really.
works fine.


.rIKmAN.(Posted 2004) [#7]
Hmmm...Thats exactly what I¬m doing Ant, and exactly what I did with the CS guy that I did...it just doesn`t seem to be working.

I`ll go back and check everything, and also make sure its not the model.

Cheers.

PS. You a regular here now ur not on BC anymore? ;)