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.

Newcomers DBPro Corner / frame numbers

Author
Message
jayceeDB
23
Years of Service
User Offline
Joined: 3rd Jul 2003
Location:
Posted: 12th Aug 2003 10:25
Hi All,

I'm trying to append model animations and am wondering if there's a way to see how many frames each model has. For example, assuming, the following code is correct...

If I append 4 movements together, when I want to call a specific frame group, how will I know which frame starts and ends with that particular model?

********************

load object "models\h-android-idle.x", OBJenemy
append object "models\h-android-move.x", OBJenemy, total object frames (OBJenemy) + 1
append object "models\h-android-attack1.x", OBJenemy, total object frames (OBJenemy) + 1
append object "models\h-android-die.x", OBJenemy, total object frames (OBJenemy) + 1

*********************

For example, how will I know that when it's time for the android to die, that I know to PLAY OBJECT OBJenemy, 45, 60??? How do I know the start frame is at 45 and the end frame is at 60?

thanks,
john...
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 12th Aug 2003 13:48 Edited at: 12th Aug 2003 22:40
simple math, use total object frames to get the number of frames of animation for each one you load, if you have idle.x has 20 frames and walk.x has 20 frames then you have a total of 40 frames of animation, idle.x starts at 1 and ends at 20, and walk.x starts at 21 and ends at 40, if you add another animation like attack.x and it has 30 frames then it starts at 41 and ends at 70, just get the numbers for each animation from "total object frames" as you add each animation to the other and store the values in named variables eg:

load object "idle.x",1
idle=total object frames(1)
append object "walk.x",1,idle+1
walk=total object frames(1)
append object "attack.x",1,walk+1
attack=total object frames(1)

then to do an action

play object 1,idle+1,walk

makes him walk

play object 1,walk+1,attack

makes him attack etc, it`s always a good idea to give your code meaningfull names, if you do it right then it makes the code almost as easy to read as English, cheers.

Mentor.

jayceeDB
23
Years of Service
User Offline
Joined: 3rd Jul 2003
Location:
Posted: 13th Aug 2003 00:15
GREAT!

Thanks.

Didn't know about the total object frames command.

Every time I post a forum note, I learn a little more about this smart and well thought out language!

thanks again,
john...

Login to post a reply

Server time is: 2026-07-07 05:38:49
Your offset time is: 2026-07-07 05:38:49