Well, you have to load the file, then delete the animations, then you give a new animation to this object, and finaly you can save it in a file. Here's how I did it for the dragon2 object on the DBC CD :
hide mouse : sync on : sync rate 60
rem Loads the object
load object "dragon2.x",1
rem Deletes the old animation
clear all object keyframes 1
rem Gives an animation to the object
rotate limb 1,15,0,0,330:rotate limb 1,17,0,0,30 : set object keyframe 1,0
rotate limb 1,15,0,0,20:rotate limb 1,17,0,0,340 : set object keyframe 1,5
rotate limb 1,15,0,0,330:rotate limb 1,17,0,0,30 : set object keyframe 1,10
rem Begins the new animation
loop object 1
rem Moves the cam to the back
while spacekey()=0: sync
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)
Rem Control input for camera
If Upkey()=1
X# = Newxvalue(X#,CameraAngleY#,1)
Z# = Newzvalue(Z#,CameraAngleY#,1)
Endif
If Downkey()=1
X# = Newxvalue(X#,Wrapvalue(CameraAngleY#-180),1)
Z# = Newzvalue(Z#,Wrapvalue(CameraAngleY#-180),1)
Endif
Yrotate camera CurveAngle(CameraAngleY#,OldCamAngleY#,24)
Xrotate camera CurveAngle(CameraAngleX#,OldCamAngleX#,24)
Position Camera X#,Y#,Z#
Rem Refresh Screen
Sync
rem Benutzerinformationen
set text size 28
endwhile
while spacekey()=1 : endwhile
stop object 1
rem Saves the new animation
save object animation "myanim.dat",1
rem Deletes Keyframes
for t=0 to 10
clear object keyframe 1,t
next t
rem Deletes Object
delete object 1
And to view the animation at anytime, you can use
hide mouse : sync on : sync rate 60
Datei$="dragon2.x"
rem Lädt ein einfaches Model
load object Datei$,1
rem Löscht jegliche Animation des Modelles
clear all object keyframes 1
rem So eben erstellte Animation an das Modell hinzufügen
append object animation Datei$,"myanim.dat",1,0
rotate OBJECT 1,0,285,00:position OBJECT 1,2500,799,-188:loop object 1
I hope that will help you.
******************************************************[Edited]
Oops, I didn't read right, but here's the answer : If your animation goes with append, then stop the animation and begin the next one. If these are separate objects, you shoulde simply replace the walking object with the runnning object.
"Begin at the beginning, and go on till you come to the end: then stop." - Lewis Carroll