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.

DarkBASIC Professional Discussion / Learning Dark BASIC pro or classic : Need Help

Author
Message
DarkDISCUSSION
15
Years of Service
User Offline
Joined: 6th Jul 2011
Location: Ft Madison, IA
Posted: 11th Aug 2011 21:42
I have left Blitz 3D and need help using Dark BASIC
I cannot figure out how to get one of my own models animated into
a game. I cannot load 3DS files because my copy of 3DC_SE (Special Edition) can't export to that format so I use DirectX file format.
My Pal Mat can't tell me how to use it because he hasn't used it since 2002..... Please Help!

Thanks ahead of time!

Austin H Wicker
http://captainwicker.webs.com/
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 12th Aug 2011 00:19
First off use DB Pro not Classic, it's just better.

What format are your models in? If 3DS then you might be able to load them already, same for X.

What part of the process of getting your animated models into DBP are you having trouble with? What have you tried to do?

DarkDISCUSSION
15
Years of Service
User Offline
Joined: 6th Jul 2011
Location: Ft Madison, IA
Posted: 13th Aug 2011 00:49
Ok I have typed the following code but when I compile it nothing happens.
\/
Rem Loading My Object P1

Load Object "P1.X",1

Suspend For Key
--------------------
Ok the DirectX file should be attached if this matters or not
I do not know. If there is something I should have or should not have coded please tell me.
Thanks!

Austin H Wicker
http://captainwicker.webs.com/
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Aug 2011 01:09
When you SUSPEND FOR KEY you lock up the whole program, including updates to the screen. At the top of the program type:



...to set the screen refresh rate to 60 frames per second. Then instead of Suspend, use:



Disrupter52
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 13th Aug 2011 06:22
Try not to leave the sync rate at 0, it'll go as fast as your computer is able to, which if your computer is good, will be impossibly fast (5000+ fps if there isnt alot going on on mine) so limit to either 30 or 60.
DarkDISCUSSION
15
Years of Service
User Offline
Joined: 6th Jul 2011
Location: Ft Madison, IA
Posted: 13th Aug 2011 23:16
If I do not type Suspend for key or either wait key
How to I get the Runtime Window to stay on the screen?
And even If I do manage to get my object on the screen (Done)
How can I get the model to perform movement after a keyboard key is pressed?
Sorry for my incorrect terms of speaking but I can now get my P1.X model to appear on the screen but only for a small amount of time.

@: baxslash
Thank you! I will use DBPro


Austin H Wicker
http://captainwicker.webs.com/
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 14th Aug 2011 02:59
Quote: "How to I get the Runtime Window to stay on the screen?"

Do what BatVink suggested...


Quote: "How can I get the model to perform movement after a keyboard key is pressed?"

Here is a little demonstration. Have a good look at the structure of the program and instead of making a sphere you would load your object.



Hope this helps

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 14th Aug 2011 03:45 Edited at: 14th Aug 2011 03:58
Every program I start in DB normally looks like this.

I automatically put that at the start of every project. The first line sets up the display res, colour depth and framerate (the 1 meaning your monitors refresh rate). Then I turn on sync (otherwise it defaults at 40fps I believe, but that could be different these days). Then put a loop to display whatever I will be doing, with the sync at the end to refresh the screen. That code obviously displays a blank screen as I have loaded nothing up, but if you use it as the basis to start your projects it will soon get you used to how DB Pro and DB work. If you leave out the display mode command it will default to 640x480 or whatever your project settings are in the ide.

Edit - Here's a little update showing 2 loops instead of one and how easy it is to switch between. Be aware if you had a sprite or 3d object loaded, you would still be able to view them in either screen as it is. You would need to delete and reload or hide the object, sprite when switching loops. This is just a basic example.


http://s6.bitefight.org/c.php?uid=103081
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 14th Aug 2011 03:56 Edited at: 14th Aug 2011 03:57
Quote: "the 1 meaning your monitors refresh rate"

Doesn't the 1 mean vsync is on, 0 for off? But it's a good idea. For every large project I start I call a _configure_program() which sets sync rate, display mode etc.

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 14th Aug 2011 04:04
Yes, but it also sets it to the monitors refresh rate. Setting it to 0 will run as fast as possible. If you had an old style monitor where you can change the refresh rate, you could see that this is true, as the fps of DB will report whatever you set it to, if it can keep up of course.

http://s6.bitefight.org/c.php?uid=103081
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 14th Aug 2011 05:23
Ahh I see what you mean now, sorry I misinterpreted your previous statement as to you get to choose the refresh rate via typing in a number. Glad to see I'm not the only one that turns it on, many people seem to hate vsync but I find it rather useful.

DarkDISCUSSION
15
Years of Service
User Offline
Joined: 6th Jul 2011
Location: Ft Madison, IA
Posted: 14th Aug 2011 19:26
Any chance that anyone could show me how to make a game model play an animation while pressing a key?

Would you just type some kind of scancode or something?

Thanks Guys!

Austin H Wicker
http://captainwicker.webs.com/
DarkDISCUSSION
15
Years of Service
User Offline
Joined: 6th Jul 2011
Location: Ft Madison, IA
Posted: 25th Aug 2011 20:27
Oh Yes! never mind I finally figured it out although my DBPro 7.5 update's compiler wasn't working so I had no choice but to use the Original DB (classic). Thanks anyway.

Austin H Wicker
http://captainwicker.webs.com/

Login to post a reply

Server time is: 2026-07-10 22:38:07
Your offset time is: 2026-07-10 22:38:07