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 / Append command

Author
Message
Gamedesign er20
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 5th Oct 2006 01:33
I have had a problem with my append object command, and I am not sure if it is a foolish mistake, or there is something wrong with my DB. Here is a test code that would not work on my DB, please let me know if it works on yours:

note: The code uses a DarkMatter model, if you do not have DarkMatter than just switch it with one of the free models DB comes with.

Cocacola and Pepsi aren't that differnt. Deal with it.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Oct 2006 03:12 Edited at: 5th Oct 2006 03:12
Im guessing your using classic, the 3ds files work alone prior to this yes?

You have to know your models frame counts, an example of two actions
both taking around 30 frames would look like this.

1 to 30 | 31 to 60

do your append prior to the loop, the computer is rapid fire executing that command when you push the upkey with that command structure, you really only want to do this command once prior to the gameplay.

jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 5th Oct 2006 05:00
Yes, and also...it is a wise idea to use a variable to "debounce" the keystroke. It is not actual debounce like in hardware, but it will prevent your code from trying to do the same action a few hundred times. I use a value that equates to about 50mSec. It depends on the state of your kbd in Windows. You will absolutely get repeats on almost every keystroke in most cases. Once you have that in-place, you could still append during gameplay, but...you would need a particularly excellent reason not to load all animation data for a model at the time you load it in the first place. The animation subsystem is sufficiently enabled to play them in any order that you want.

Something like:

global debounce as integer

.
.
.
do
if debounce <> 0 then dec debounce

if upkey() = 1 and debounce = 0
.
.
debounce = 50
endif
.
.
loop

Also, I do not use upkey()...I use scancode() because it handles the whole kbd, not simply one key.

Your append looks hardcoded; are the numbers correct? I'm not understanding why you haven't used the total object frames function call? (Is it available to you?) Anyway, I will try with that model later tonight. I have only used the people in DM so far. They work considerably differently than what I see in your code. Also, I use DBPro. I do not think that matters much, however.

Login to post a reply

Server time is: 2024-11-26 09:47:55
Your offset time is: 2024-11-26 09:47:55