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 / multiple anims.

Author
Message
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 23rd Sep 2011 02:02
Hey guys,

So im having some confusion on dark matters animation system.
In my code i have 1 object and that object is the idle animation for
the swat guy. But how do i make it so that i can play diffrent anims on the one guy? I see the files : Swat attack.x And swat die.x but how can i make my one object play them separately.

I hope that made sense to anyone .

and to those to help!

.....the feel of solitude hurts inside....
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 23rd Sep 2011 12:13
I think you're looking for "Append Object".

Help files don't make much sense, but I think it's like this:
APPEND OBJECT "Swat attack.x", 1, 50

This should dump the swat attack animation into object 1 (change to be the object you've loaded your "Swat Idle.x" file as), and the animation will start at frame 50 - so call "Play Object 1, 50" to start the character attacking.

Actually, once you've appended all the animations you need, you might want to use "Save Object" and export it as a .dbo object file. Then you'll only have to load a single file into your game.

We spend our lives chasing dreams. Dark Basic lets us catch some of them.
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 23rd Sep 2011 23:09
Thanks,

but i used the code:

APPEND OBJECT "files/models/H-SWAT-Idle.x", 1, 50

only to find out an error popped up saying: Runtime Error 7602 - animation keyframe does not exist at line 35.

So yeah... anyway thanks for the help! But if theirs any fix, id love to hear!

-Tokyomage

.....the feel of solitude hurts inside....
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 23rd Sep 2011 23:10
I think it has to do with the number of frames the object is.
, If so how can i find out?

Thanks,

-Tokyomage

.....the feel of solitude hurts inside....
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 24th Sep 2011 11:57
Quote: "I think it has to do with the number of frames the object is."

Yes - sorry, I haven't used 3D animation for a while, and the help files didn't help much.

Basically, the new animation has to start up from exactly where the old one finished.

Try this instead:

Don't forget to make a note of where each animation starts and finishes!

This example comes from the helpfiles:


Hope this helps!

We spend our lives chasing dreams. Dark Basic lets us catch some of them.
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 24th Sep 2011 16:29
Appending the object works great!

But heres what im trying to say, how do i know when the frames stop?
(for the animation)?

.....the feel of solitude hurts inside....
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 25th Sep 2011 01:34
anyone?

-Tokyomage

.....the feel of solitude hurts inside....
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 25th Sep 2011 12:26
Simple - use "Total Object Frames(1)"

For example:


Now, to play a given animation, call this command:

to play the animation once, or

to loop the animation.

Note - don't do this:

or you will always be starting the animation, so you'll only ever see the first frame!

We spend our lives chasing dreams. Dark Basic lets us catch some of them.
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 26th Sep 2011 02:13
Your a life saver man!
Thanks plenty dude!

and about that stuff i owed you...

+ for you!

-Tokyomage

.....the feel of solitude hurts inside....
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 26th Sep 2011 02:16 Edited at: 26th Sep 2011 19:49
Oh and by any chance, in my code, i whant
the walking animation to play when
the up key is pressed. But in my code
i have play animation (whatever the walking frames are)
in the do loop area but when i press the upkey (and hold) the animation does not play until i let go of it.
So basicly i whant the animation (walk) to happen while the upkey is pressed. I mean really iv been doing this for only 12 days im not to sure what to do.
Any way thanks again for your support!


-Tokyomage

.....the feel of solitude hurts inside....
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 26th Sep 2011 18:36
Firstly - never, ever, ever post your age in an online forum.

Quote: "i have play animation (whatever the walking frames are)
in the do loop area but when i press the upkey (and hold) the animation does not play until i let go of it.
So basicly i whant the animation (walk) to happen while the upkey is pressed."

As I said before, if you do this:

then only the first frame will show. If you do this (as I think you are doing):

then as long as the upkey is pressed, you set the animation to its first frame.

Use a variable to say whether the object is walking or not:


Look at the code carefully and try to understand what's happening. At the start, the Swat character is idle - so set "ObjectWalking" to 0. In the main loop, the user presses the upkey so loop the walk animation - and set "ObjectWalking" to 1.

The next time the program loops around, "ObjectWalking" is already 1, so the object animation is already playing and the upkey input is ignored. But, we have to reset it, so the "else" statement (for if the upkey isn't pressed) is that "ObjectWalking" is 0 - so next time it's pressed, we can start the animation again.

Now see if you can modify this to show the Idle animation if the upkey isn't pressed.

Hope this helps!

We spend our lives chasing dreams. Dark Basic lets us catch some of them.
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 26th Sep 2011 20:23 Edited at: 26th Sep 2011 20:24
I posted my age? where? But its required in the profile editor thing.

Back to the point, thanks so much for the help man! I am really thankful that someone cares! Now im probably going to ask some more stuff but before i do that heres a free refill! .

Now about the other question,
This problem refers to cameras.
If you run the so called "room demo"
located in the projects folder you might have noticed
its third person camera view perspective, And boy is
it a good one. Any advice on how i can make this happen to my swat
object guy? Again thanks a plenty for your assistance, couldnt
have done this swithout you

-Tokyomage

.....the feel of solitude hurts inside....
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 26th Sep 2011 21:20
Quote: "I posted my age? Where?"

Sorry . I misread "I've been doing this for only 12 days" as "I'm only 12 years old" - really sorry, it's been a long day and I'm a bit tired.

Not sure about the room demo, can't seem to find it. I think what you're after is "Set Camera To Follow" - try looking up the demo of it with the help files.


x#,y#,z# are the point in space the camera is to point at. Angle is evaluated from the dx#,dy# values in the help file code (I think it helps define how to keep the camera behind the object being tracked).

Distance# sets how far behind the object the camera is to appear, Height# sets how far above the ground the camera is to be at. Smooth# is from 1.0 to 100.0, and sets how gently the camera swings round to follow something (1.0 for immediate jumping, 100.0 for a very slow, gentle motion). Leave Collision as 0 for now, set it to 1 if you build a world for your chracter to explore - you'll define scenary as "static" and if this flag is 1 then the camera will not "disappear" through walls.

We spend our lives chasing dreams. Dark Basic lets us catch some of them.
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 26th Sep 2011 22:41
Wow, looks daunting .

By any chance could you give like an example?

Thanks,

-Tokyomage

.....the feel of solitude hurts inside....
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 26th Sep 2011 23:33 Edited at: 26th Sep 2011 23:34
Not too daunting. TDK did an excellent tutorial on it here:
http://forum.thegamecreators.com/?m=forum_view&t=123485&b=10
It was for DBC (an older version of DBPro), but I don't think you'll have trouble running through the stuff.

And here's my best shot at a demo:

Hope this helps, and sorry once again for my mistake earlier

We spend our lives chasing dreams. Dark Basic lets us catch some of them.
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 28th Sep 2011 01:08 Edited at: 28th Sep 2011 01:08
Cool, had no idea there was a tut. on that

And by any chance im working on a simple inventory system where when you press the i button it displays the inventory, and when you press it again while the inventoires up it will exit it. It sounds simple but it doesnt seem like i could get it to happen .

Anyway about the mistake earlier: Dont worry about it, i do that sometimes too! .

-Tokyomage

.....the feel of solitude hurts inside....
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 28th Sep 2011 17:18
anybody?

-Tokyomage

.....the feel of solitude hurts inside....
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 28th Sep 2011 17:59
You need to use boolean flags - basically a value that can be 1 (true) or 0 (false). Have a flag for ShowInventory that flips true-to-false or false-to-true each time the "i" key is pressed. Have a second flag that prevents the program from responding to the "i" key input until the user has released the key:



Hope this helps!

We spend our lives chasing dreams. Dark Basic lets us catch some of them.
tokyomage
14
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 1st Oct 2011 19:46
Ok, i think i get it now .
and thanks again for my many questions answered! I cant ask much more from you, your awesome!

-Tokyomage

.....the feel of solitude hurts inside....

Login to post a reply

Server time is: 2024-11-24 01:45:24
Your offset time is: 2024-11-24 01:45:24