Here's the code, I've commented out a lot to try to isolate the problem.
`Enhanced Animations
`Example 01: The Basics
`---------------------------------------------
`by: Ron Erickson 18-Jan-07
`**********************
`Setup
`**********************
`SYNC ON
`SYNC RATE 0
`SET DISPLAY MODE 1024,768,32
`AUTOCAM OFF
`**********************
`Load Objects:
`**********************
`Load Character model
load object "media\full.x",1
`yrotate object 1,180
`fix object pivot 1
load image "media\sc.png",1
texture object 1,1
`set object emissive 1,rgb(128,128,128)
`position object 1,0,0,0
`Camera
`POSITION CAMERA 35,65,100
`POINT CAMERA 0,45,0
`Set the default play speed (frames per second) of animations
EnAn_SetDefaultPlaySpeed 10
`EXTRACT ANIMATION DATA FROM MODEL
`************************************************
`Normaly, this would be done outside of your game as you are preparing your media.
`Extracting animations pulls the animation data out of your files
`and puts it into it's own file format
`SYNTAX: EnAn_ObjExtractAnimation ObjID, FileName$, StartFrame#, EndFrame#
`Note: if you set the EndFrame# variable to -1, it will use the last frame in the model
EnAn_objExtractAnimation 1, "Run.anim", 55, 60
EnAn_objExtractAnimation 1, "Walk.anim", 35, 45
EnAn_objExtractAnimation 1, "Pose.anim", 0, 30
`LOAD ANIMATIONS
`************************************************
`This will load the animations that you extracted above
`SYNTAX: AnimID = EnAn_AnimLoad(Filename$)
`The "AnimID" variable is what will be used to refer to your loaded animation
PoseAnim = EnAn_AnimLoad("Pose.anim")
WalkAnim = EnAn_AnimLoad("Walk.anim")
RunAnim = EnAn_AnimLoad("Run.anim")
`CREATE OAC LINK TO OBJECT
`************************************************
`This will allow you to apply animations to an object. It provides the object with all of the
`internal variables that are needed for control.
`SYNTAX: oacID = EnAn_oacCreate( ObjectNo )
`The "oacID" variable is what will be used to work with that particular DBpro object
`Each DBpro object that you want to control with Enhanced Animations will need an oacID
oacID = EnAn_oacCreate( 1 )
`PLAY THE WALK ANIMATION
`************************************************
`This command will begin playing the Walk animation on the object.
`SYNTAX: EnAn_oacPlayAnim oacID, Limb, AnimID, StartFrame#, CurrentFrame#, EndFrame#, loop, ExChild
`The oacID refers to the object that it is linked to.
`The Limb variable will apply the animation to the specified limb. Enhanced Animations can play animations
`on entire objects OR specific limbs.
`The StartFrame and EndFrame parameters describe what is considered the beginning and end of the animation.
`If the EndFrame parameter is set to a negative number, then the last frame of the animation file will be used
`The current frame parameter describes what frame to begin playing on. If the loop parameter is set to one (1),
`then when the animation reaches the end frame, it will start over at the start frame.
`If the exChild (or Exclude child) parameter is set to one (1), then ONLY the specified limb will have the
`animation applied to it. Otherwise, the specified limb and all of it's children in the limb hierarchy will have
`the animation applied to it.
EnAn_oacPlayAnim oacID, 1, WalkAnim, 0, 0, -1, 1, 0
`Get the current time value.
time = timer()
`**********************
`Main Loop:
`**********************
DO
position object 1, 0, 0, 0
print camera angle x()
print camera angle y()
print camera angle z()
control camera using arrowkeys 0, 1, 1
`ELAPSED TIME
`*****************************************
`Get the amount of elspsed time since the last time check
elapsedTime = timer() - time
`Reset the time check
time = timer()
`UPDATE THE OAC
`*****************************************
`This will update the object's animation by telling the object how much time has elapsed
`SYNTAX: EnAn_oacUpdate oacID, elapsedTime
EnAn_oacUpdate oacID, elapsedTime
`TRANSITION TO NEW ANIMATIONS
`*****************************************
`Using a transition animation work very similat to Playing an animation (as described above)
`The only difference is the addition of the TransTime parameter wich tells the object how long
`it should take for the transition from the currently playing animation to the new animation
`that you are transitioning to.
`SYNTAX:
if returnkey() = 1
`Transition to walk over 2 seconds
EnAn_oacAnimTransition oacID, 1, WalkAnim, 0, 0, -1, 1000, 1, 0
endif
if spacekey() = 1
`Transition to run over 1 second
EnAn_oacAnimTransition oacID, 1, RunAnim, 0, 0, -1, 1000, 1, 0
endif
if shiftkey() = 1
`Transition to pose over 1 second
EnAn_oacAnimTransition oacID, 1, PoseAnim, 0, 0, -1, 1000, 1, 0
endif
SET CURSOR 0,0
PRINT "Enhanced Animations"
PRINT "Example 01: The Basics"
PRINT "By: Ron Erickson"
PRINT "visit: www.GameToolshed.com"
PRINT "---------------------------------------------------------------"
PRINT "This example shows the basics of how Enhanced Animations works!"
PRINT "Press ENTER to switch to Walk animation"
PRINT "Press SPACE to switch to Run animation"
PRINT "Press SHIFT to switch to POSE"
PRINT "---------------------------------------------------------------"
IF EnAn_oacGetLimbPlayAnimID(oacID, 0) = WalkAnim then PRINT "Current Play animation: Walk"
IF EnAn_oacGetLimbPlayAnimID(oacID, 0) = RunAnim then PRINT "Current Play animation: Run"
IF EnAn_oacGetLimbPlayAnimID(oacID, 0) = PoseAnim then PRINT "Current Play animation: Pose"
IF EnAn_oacGetLimbTransIsActive(oacID, 0) = 1
`IF EnAn_oacGetLimbTransAnimID(oacID, 1) = WalkAnim then PRINT "Switching to: Walk "
`IF EnAn_oacGetLimbTransAnimID(oacID, 1) = RunAnim then PRINT "Switching to: Run "
`IF EnAn_oacGetLimbTransAnimID(oacID, 1) = PoseAnim then PRINT "Switching to: Pose "
ENDIF
` SYNC
LOOP
@wickedx no dice unfortunately, still the same.