Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / having trouble appending objects

Author
Message
Xarshi
19
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 3rd Jan 2006 22:00
do you need to make a seperate object for the animation your trying to append to the other object? or do you have to use append object animation? cuz ive tried for a long time and cannot get this to work. if you can help,thanks.and another thing,is there something to say like if the animation is done,place object(i have the place object command)

HARK!
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Jan 2006 22:22
load object file$, objnr
is used for loading a non existing object. If the object contains animation, the animation will be loaded. If the objnr is already taken, the program will return an error.

append object file$, objnr, startFrame
is for adding an animation sequence to the object objnr. It doesn't HAVE to be the same object, but it is recommendable. (The animation contains frame data for each limb. Which means, you can apply the animation to any object as long as it has the same limb number and hierarchy).

play object objnr[,startframe][,endframe]
This command will play a previously loaded animation sequence of an object. If the object contains no animation information, the program will return an error.

loop object objnr[,startframe][,endframe]
The same as play object, except that it loops itself over and over again.

set object speed objnr, speed
This command sets the speed of an object. The higher speed is, the faster the object will animate.

total object frames( objnr )
returns the number of total keyframes of an object.

object frame( objnr )
returns the current object frame (When playing/looping).

object playing( objnr )
Will return a 1 when the object is playing. Otherwise, a 0 is returned.

object stopped( objnr )
Will return a 1 when the object is not playing. Otherwise, a 0 is returned. Pretty useless command, since the same can be achieved with object playing.

NOTES:
Animation can be stored in a 3ds, DirectX or the Character Shops own format. But, another way of storing animation, is using DBC itself. This feature is not available in DBP anymore.

To animate in DBC you can:
offset limb objnr, limbnr, x, y, z
for offsetin the limb.

rotate limb objnr, limbnr, x, y, z
for rotating the limb.

set object keyframe objnr, keyframe
for storing a keyframe to an object.

DBC will automatically smoothen the animation sequence for you. which means that the object will animate smoothly when you only defined keyframe 0 and 20.



These commands aren't all the commands DBC has for animation!
Xarshi
19
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 3rd Jan 2006 23:01
well that did give me some ideas for stuff,but i still need help to append the object.it just returns an error saying it cant.

HARK!
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Jan 2006 15:48
Maybe you could tell us what the exact error is?

Here's an example for loading animation.

We have 2 animation files. "Walk.X" and "Idle.X". At this point we don't know how much keyframes the object has:
load object "Walk.X", 1

We have loaded the object and walking animation. If you loop the object, you'll see that it'll walk.

Now appending:
We don't know how much frames the walking animation contains, so we'll extract that data now.
WalkFrames = total object frames(1)

And we append the idle animation, using the data we just stored:
append object "Idle.X", 1, WalkFrames

That's all for the loading.

Login to post a reply

Server time is: 2025-05-23 00:24:53
Your offset time is: 2025-05-23 00:24:53