"Mobiius" wrote: "With load object with children, it loads all limbs at separate objects so you'd need to texture all child objects yourself."
That is not right! (Maybe mixing up meshes and objects)
1st LoadObjectWithChildren has to work like LoadObject when it comes to textures
2nd SetObjectAnimationSpeed() should work in reverse, but maybe SetFrame to the last frame of the animation is needed before
3rd the door object is broken (when compare to the scifiassaulttroop.X)
I am using
scifiassaulttroop.X
And it works with negative speed for reverse animation and also with loading it with children and using SetObjectImage() like I would do on LoadObject
So there could be a problem with the functions, but I would say, that the door objects are not created like the scifiassaulttroop.X
// Project: openDoor_FL
// Created: 2016-11-16
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "openDoor_FL" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
dobj = LoadObjectWithChildren("D_Steele_rib2.X")
dob2 = LoadObject("D_Steele_rib2.X")
tobj = LoadObjectWithChildren("scifiassaulttroop.X")
tob2 = LoadObject("scifiassaulttroop.X")
dimg = LoadImage("door_steel_rib2_D2.jpg")
timg = LoadImage("scifiblue_small.jpg")
SetObjectImage(dobj,dimg,0)
SetObjectImage(dob2,dimg,0)
SetObjectImage(tobj,timg,0)
SetObjectImage(tob2,timg,0)
SetObjectPosition(dobj,-100,0,0)
SetObjectPosition(dob2, -50,0,0)
SetObjectPosition(tobj, 0,0,0)
SetObjectPosition(tob2, 50,0,0)
SetCameraPosition(1, 0,0,-150)
SetCameraLookAt(1, 0, 0, 0, 0)
diri = 1
tiri = 1
Function PlayAnim(obj,direction,dur)
Anim$ = GetObjectAnimationName(obj,1)
/*
Frames = GetObjectAnimationDuration(obj,Anim$) // because in most of the X-files only one animation is set, but it contains several
*/
Frames = dur
PlayObjectAnimation(obj,Anim$,0,Frames,0,0)
If direction > 0
SetObjectAnimationFrame(obj,Anim$,0,0)
Else
SetObjectAnimationFrame(obj,Anim$,Frames,0) // for only the first animation to demonstrate
EndIf
SetObjectAnimationSpeed(obj,direction*30) // 30 frames per second
EndFunction direction
do
Print( Str(ScreenFPS(),2)+" An:"+Str(GetObjectAnimationTime(dobj),2) )
If GetObjectAnimationTime(dobj) >= 30 or GetObjectAnimationTime(dobj) = 0// Get ... Animation ... Time ...
diri = diri * (-1)
PlayAnim(dobj,diri,30)
EndIf
If GetObjectAnimationTime(tobj) >= 19 or GetObjectAnimationTime(tobj) = 0// Get ... Animation ... Time ...
tiri = tiri * (-1)
PlayAnim(tobj,tiri, 19)
EndIf
Sync()
If GetRawKeyPressed(27): Exit: EndIf
loop
Used media and source the attachment