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.

3 Dimensional Chat / Animation in DBPro

Author
Message
Polar Bear
22
Years of Service
User Offline
Joined: 16th May 2004
Location:
Posted: 28th May 2004 07:11
Hello I'm a newbie and experiencing problems with my animation. I've tried out using a simple command like

load object "C:\Program Files\Dark Basic Software\Dark Basic Professional\Projects\Animation\Human.x",1
set object speed 1,100
play object 1
wait key

and it works but using another code, it does not play.. can somebody help me retify this problem. I'm trying to move the human when "t" is being pressed
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 31st May 2004 04:36
you will probably need a method to trap the keypress and play or loop the animation according to what key is pressed.


look at the scancodes and keystate commands for a better key input control.


fall down seven times, stand up eight
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 31st May 2004 18:59 Edited at: 31st May 2004 19:01
I've been playing A LOT with animation recently, and have pretty much sussed most of the problems. Things to bear in mind to solve your problem:

-As indi said, you need to trap the keypress somewhere.
-If you're playing the animation with PLAY OBJECT, you must only do this once. If you run the same command every loop, you'll keep setting the animation back to the first frame, and it'll look like its static.
-If you are using the LOOP OBJECT command, you can call this command every program loop and DB will still animate the object. I have no clue why. Inconsistent weirdness, I guess.

Something like this would work for you.


There are a plethora of niggles with the object animation, but it does work, so long as you know what to tinker with, so if you have any more problems, throw up a post and if I see it I'll try and help.

EDIT: Don't use inkey() btw. Use keystate() to avoid only being able to press one key at a time. Use the scancode() command to find out the numeric value for a specific key, then use the keystate() command to check if that key is being pressed.

Login to post a reply

Server time is: 2026-07-06 16:49:06
Your offset time is: 2026-07-06 16:49:06