I have been playing with various animation commands, and have yet to figure out how to switch from one animation, to another, and go back to the first. example would be standing idle animation, then moving animation when said key is pressed. when that key is released, going back to the idle animation. I am using the Mutant Alien from TGC store which also came in my dark studio (Dark Matter). I am using the one from tgc store though, because according to what I have read, this method is easier for loading animations. here is the code I have for this animation test that I failed at terribly.
REM ~~~~~~~~~ANIMATION TEST~~~~~~~~~~~~
Global CamHeight REM Global variable for Camera Height
CamHeight = 15 REM CamHeight eqauls 15 units
Sync on : Sync Rate 60 REM Turn Sync On, Set Sync to 60 Frames Per Second
Backdrop on : Color Backdrop 0 REM Turns Backdrop On, and colors it black
REM Player Object (Animation object)
Load Image "Mutant01_D2.dds",1 REM Loads Player Model Image
Load Object "Mutant (Unarmed).X",1 REM Loads Player Model
Texture Object 1,1 REM Textures the Player Object
Scale Object 1,100,100,100 REM Scales the Player object 200% on X,Y,Z Axis
Loop Object 1,30,95 REM Plays Player Object Animation from frame 30-95
REM ~~~~~Main Loop~~~~~ REM
Do
Control Camera Using Arrowkeys 0,5,5 REM Moves Camera front,back,and turns camera left and right.
Camera_Up_Down() REM Function moving camera up and down
Animate_Player() REM Function changes player animation from idle to moving.
Sync
Loop
REM ~~~~~Function Library~~~~~ REM
Function Camera_Up_Down()
If Keystate(17)=1 REM If the W key is pressed
Inc CamHeight REM Increase CamHeight
Position Camera Camera Position X(0), CamHeight, Camera Position Z(0) REM Parameters for Cam Height change
EndIf REM End the IF statement
If Keystate(31)=1 REM If the S key is pressed
Dec CamHeight REM Decrease CamHeight
Position Camera Camera Position X(0), CamHeight, Camera Position Z(0) REM Parameters for Cam Height change
EndIf REM End the IF Statement
EndFunction
Function Animate_Player()
If Spacekey()=1 REM If space key is pressed
Loop Object 1,142,172 REM Loops object animation from frame 142 to 172
EndIf REM End the if statement
EndFunction
The darkest minds, are often the brightest.