ok,
Thanks for the help guys.
BTW joe, you're right about the running & strafing thing ... that was a case of Problem Exists Between Keyboard And Chair.
So would the folling code be along the right lines?
(in particular the MergeBones function at the bottom)
Obviously in the 'real' game moveSequence might be anything from 1 to 5 and otherSequence might be anything from 6 to <numSequences>
Thanks again.
Thanks for the help guys.
BTW joe, you're right about the running & strafing thing ... that was a case of Problem Exists Between Keyboard And Chair.
So would the folling code be along the right lines?
(in particular the MergeBones function at the bottom)
player = CreatePivot() playerMesh = LoadAnimMesh( "player.b3d" , player) ; player mesh + animated skeleton bones = LoadAnimMesh( "bones.b3d" , player) ; just the animated skeleton (identical animation frames) ExtractAnimSeq( playerMesh,0,20 ) ; sequence 1 = run ExtractAnimSeq( bones,0,20 ) ExtractAnimSeq( playerMesh,21,30 ) ; sequence 2 = attack ExtractAnimSeq( bones,21,30 ) moveSequence = 1 otherSequence = 2 Repeat If moveSequence <> 0 And otherSequence <> 0 Then Animate playerMesh, 1, 1, otherSequence Animate bones, 1, 1, moveSequence mergeSequences = True Else If moveSequence <> 0 Animate playerMesh, 1, 1, moveSequence mergeSequences = False Else If otherSequence <> 0 Animate playerMesh, 1, 1, otherSequence mergeSequences = False Else mergeSequences = False EndIf UpdateWorld() If mergeSequences = True Then MergeBones( bones, playerMesh, "LeftUpperLeg" ) ; (see below) MergeBones( bones, playerMesh, "RightUpperLeg" ) MergeBones( bones, playerMesh, "LeftLowerLeg" ) MergeBones( bones, playerMesh, "RightLowerLeg" ) MergeBones( bones, playerMesh, "LeftFoot" ) MergeBones( bones, playerMesh, "RightFoot" ) EndIf RenderWorld() Flip() Until KeyHit(1) End Function MergeBones( sourceBones, destMesh, boneName$ ) source = FindChild( sourceBones, boneName$ ) dest = FindChild( destMesh, boneName$ ) PositionEntity dest, EntityX(source), EntityY(source), EntityZ(source) RotateEntity dest, EntityPitch(source), EntityYaw(source), EntityRoll(source) End Function
Obviously in the 'real' game moveSequence might be anything from 1 to 5 and otherSequence might be anything from 6 to <numSequences>
Thanks again.