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 / How do I load a .dbo file into darkbasic?

Author
Message
stephen66
15
Years of Service
User Offline
Joined: 8th Sep 2010
Location:
Posted: 9th Sep 2010 05:35
Here is my code:

Rem ***** Included Source File *****
Set Display Mode 1024, 768, 32
Set Window On
Sync On
Sync Rate 0
Color Backdrop RGB(0,0,0)
Backdrop On
Set Camera Range 0.05,30000
Set Window Title "My Game Engine"
Hide Mouse

` Load the world object (dbo file)
Load Object "map.dbo", 1

Set Object Transparency 1,1

` Position the object
Position Object 1,0,0,0

` Position the camera
Position Camera 0,30,0

Do
Text 10,10,"FPS: " + str$(screen fps())
Text 10,30,"Polygons: " + str$(statistic(1))
gosub GetUserInput
sync
loop
end

` Routine to handle user mouse and key movement
GetUserInput:

rotate camera camera angle x()+(mousemovey()/2),camera angle y()+(mousemovex()/2),0
if camera angle x()>90 then xrotate camera 90
if camera angle x()<-90 then xrotate camera -90
cx#=camera angle x() : cy#=camera angle y() : cz#=camera angle z()
if upkey()=1
move camera 10
endif
if downkey()=1
move camera -10
endif

if rightkey()=1
xrotate camera 0: yrotate camera cy# + 90: move camera 10: xrotate camera cx#: yrotate camera cy#
endif
if leftkey()=1
xrotate camera 0: yrotate camera cy# - 90: move camera 10: xrotate camera cx#: yrotate camera cy#
endif

return

When I compile this, I get Runtime error 105, which says that the object at line 13 (my .dbo file) is there. So what's up?

Bye
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 9th Sep 2010 15:58
First of all highlight all your code and hit the "code" button.
Also is your level in the correct directory? (Same folder as .exe and your project files)

My computer surpasses all the technologies of the day. What computer do I have?

Dia
21
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 9th Sep 2010 16:23
Quote: "When I compile this, I get Runtime error 105, which says that the object at line 13 (my .dbo file) is there. So what's up?"


so...the file is there, so... there's no problem?

couldnt help it

as madscientist says above, it sounds like you aren't looking in the right directory for your dbo file. You can use explicit paths in your code (an example of mine):



or you can use relative paths (relative to where your .dbpro file is running from:



if you just want to use Load Object "map.dbo", 1 then your dbo has to be in the same folder as the .dbpro file

This is not the Sig you are looking for....

Login to post a reply

Server time is: 2026-07-22 12:41:16
Your offset time is: 2026-07-22 12:41:16