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 / loading files

Author
Message
homie g dawg
20
Years of Service
User Offline
Joined: 21st Jan 2004
Location: sitting right here infront of the comput
Posted: 26th Jan 2004 01:42
is there a way to load files from your C directory when using a load command and not having to have them in the folder that the project is in??

Im not dumb
i prefer the term mentaly challangend
Wik
21
Years of Service
User Offline
Joined: 21st May 2003
Location: CT, United States
Posted: 26th Jan 2004 01:47
just use an absolute path. eg:

load image "c:\something.jpg",1


Doremar
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location:
Posted: 27th Jan 2004 00:20
If you're using DBP, you can also play around with adding the media with the Media button on the side bar, that would allow you to keep media in a subdirectory beneath the project folder.

You might be able to use #include statements to do the same thing in DBC. I know you can include DLLs and other .dba files that way, but I'm not sure about media.

A Cloaking Robe of Elven-Kind hangs in my wardrobe behind
All those things that mother said were proper for a boy
bitechu
20
Years of Service
User Offline
Joined: 29th Dec 2003
Location: Massachusetts
Posted: 27th Jan 2004 00:32
I've been using the "set dir" and putting the absolute path to the media
eg: set dir "D:\Program Files\Dark Basic Software\Dark Basic Professional\Media"

I can't tell you if that's the best way but it works and I only need to put it in once at the top of my program.

Asus A7N266-C/1.12MB PC2100DDR/AMD XP2100+/Asus Ti4600 128MB
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 27th Jan 2004 01:11
hard-wiring your executable to look for a file in a particular directory isn't usually suggested if you are at some point going to deploy your program on another machine. You'd be better off making subfolders in your game directory and copying the media you need to the appropriate sub folder. Then when you specify in your code...

load sound "\sounds\mywavefile.wav", 1

it won't matter where the program is located or installed as long as the game directory and sub directory structure is kept intact.

-RUST-
"What the... Mooooooooooo!"
bitechu
20
Years of Service
User Offline
Joined: 29th Dec 2003
Location: Massachusetts
Posted: 27th Jan 2004 01:48
I see what your saying Cattle Rustler...but for some reason (maybe because DBP is installed on a separate drive)that method will not work on my machine.

I always get a runtime error 105 no matter how I type in the sub-directory info . When I first tried the examples nothing that included media to run would execute...and the included code was EXACTLY what you have there.

I have a bad habit of "hardwiring" things...in the case of my walkman headphones...not such a big deal....but my chopsaw...well.

Asus A7N266-C/1.12MB PC2100DDR/AMD XP2100+/Asus Ti4600 128MB
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 27th Jan 2004 02:26
put the media subdirs you need in the same folder with the exe you are building, and that should be the same place where the ide is building the .dbpro, .dba, and .bak files - then it should not matter.

-RUST-
"What the... Mooooooooooo!"

Login to post a reply

Server time is: 2024-11-26 01:30:00
Your offset time is: 2024-11-26 01:30:00