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.

Dark GDK / Make 3D character walk

Author
Message
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 15th Mar 2008 23:54
I'm using the knight from the dark matter pack included in the GDK.

I want to make him at least walk but with the code I'm using he walks first and then the animation plays while he's stock still...


Does anyone know how I can improve this to make it look like he's walking...
----------------------------------
Also another question...
I currently have the H-Knight-Move.x model loaded which obviously only has the animation of walking...
How would I go about making him to attack... The only way I can think of is to load the other model (H-Knight-Attack1.x) each time he attacks. But that certainly isn't very efficient... And doesn't work very well either...

~~Core2uu~~
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 16th Mar 2008 03:06
I'd re-animate the model in a 3d editor to have more frames of animation.....

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 16th Mar 2008 03:11
Thanks Coffee but you only answered my second question...
More importantly do you know how I can get the model to animate WHILE the left arrow key is pressed? Rather than having it animate after i release it...

~~Core2uu~~
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 16th Mar 2008 03:19
Append object is used to load more animations. You load all of them, while saving the frame offsets. In DarkMatter, not all of the frames are useful. For example, the move animations work best when frames 5 - 24 are used. That loops into a nice walk cycle. I think there are 50 frames in the move animation, but 5 - 24 and 32-50 work best for me.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 16th Mar 2008 03:42
Thanks Jinzai... You and Coffee grunt have both given me excellent solutions to my second problem but how do make the animation run WHILE a key ( for example left arrow ) is being pressed?

The animation always runs AFTER the key is RELEASED...

~~Core2uu~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th Mar 2008 03:55
You're not stopping the animation when he's not walking.

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 16th Mar 2008 05:59
@jason p: How do I stop the animation when he's not walking? I couldn't find a dbObjectMoving command because if there was one that the would be the only way I knew how to know when to stop it...

BTW I'm a noob at this and this is my first time using DGDK and C++...

~~Core2uu~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th Mar 2008 06:11
Quote: "dbStopObject
This command will stop the animation in a specified 3D object.

Syntax
void dbStopObject ( int iObject )

Related Information
BASIC3D Commands Menu
Index

"



What you Do though is make a bool variable named bStopAnimation and set it to TRUE: bool bStopAnimation=true;. Put this in the top of your loop.

Everywhere you have PLAY OBJECT (like in your code snip) immediately after do: bStopAnimation=false;

Then At the bottom of your loop, you you simply use:

if(bStopAnimation){ dbStopObject(YourID); };

Problem gone, and shows a ya a little piece of how the right logic can work FOR you



Cheers

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 16th Mar 2008 21:56
Thanks for the reply Jason but all your code managed to do was stop my animation after the key was released (which it was supposed to of course) but what I need is for the animation to PLAY WHILE I'm HOLDING the leftkey which it isn't doing... WHen I HOLD DOWN the leftkey the first or so frame of the animation shows then freezes and then it plays the rest of the animation AFTER I've released the leftkey and the object has successfully moved... Any ideas?

~~Core2uu~~
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 16th Mar 2008 22:06
Never mind I fixed it by implementing this:



---------------------------------------------------
The problem was that the animation was starting again and again... This checks if it is running and if it is it gives me an n on the top of the screen and if it isn't it loops again...

Yeah and about the "n" thing... what do I put down if I want it to check something it and it returns a true value and I want it to do nothing?

~~Core2uu~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th Mar 2008 22:40
Glad you sorted that out I came to respond but you fixed it Good Job.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th Mar 2008 22:44
(Doh) reread second post...answer follows:


See Exclaimation? Means "NOT"

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 18th Mar 2008 02:44
Uhh! I knew there must have been an easier than writing an extra if and else statement...

That makes my life a lot easier...
Thanks Jason...

I'm doing this for a math project so i have limited time... but now that I have that little snip of info it'll be a lot easier...

~~Core2uu~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 18th Mar 2008 13:04

Login to post a reply

Server time is: 2024-11-17 09:03:49
Your offset time is: 2024-11-17 09:03:49