Animating with types

Blitz3D Forums/Blitz3D Beginners Area/Animating with types

Hujiklo(Posted 2004) [#1]
Can somebody please tell me how to get this working?

;----------------------------------------------------
Global zomb=LoadAnimMesh("zombiefbx.b3d")

Type zomb

Field x#,y#,z#,rx,ry,rz
Field entit,a ,aniseq,anim
End Type

For i= 1 To 10
dozomb.zomb = New zomb
dozomb\entit = CopyEntity (zomb)
dozomb\x#=Rnd(-10,18)
dozomb\z#=Rnd(8,12)
PositionEntity dozomb\entit,dozomb\x#,0,dozomb\z#
dozomb\a=GetChild (dozomb\entit,1)
dozomb\aniseq=ExtractAnimSeq( dozomb\a,56,120 ) ;Zombie walk
Next

function dozombie()
For animz.zomb = Each zomb

Animate animz\a,1,0.35,animz\aniseq,1 ;play one-shot jump anim
Next
end function
;---------------------------------------------

I'm trying to get my head around types with various test.
Phew! - I'm beginning to think arrays are better and simpler!

Thanks.

Oh forgot to say - the 10 zombies just stand there in their neutral position.


Hujiklo(Posted 2004) [#2]
Not to worry - I've fixed it now...I can see that I was calling a new (same) anim sequence every cycle within the dozombie() function and so it appeared static; forced to the first frame each time.

Well, that was my main mistake anyhow...