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 Discussion / Probably a dumb question about media

Author
Message
Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 6th Jan 2008 08:24
So, when you are trying to build something, where do you put the media? Where would say DarkEdit look for the media, and if you put the media in their own folders like music, sprites, ect... how would you go about writing that in the code? I am asking because all I can really do is put in a path for my desktop, and I don't think that will go over well if I try to use it on some other computer.

Its probably a dumb question however haha.

Thanks for your help!

RIP Max-Tuesday, November 2 2007
You will be dearly missed.
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 6th Jan 2008 22:12
Quote: "Where would say DarkEdit look for the media, and if you put the media in their own folders like music, sprites, ect... "
Quote: "I am asking because all I can really do is put in a path for my desktop"


Well, do the same thing you did for the desktop but instead put in the directory for the media instead, you don't have to have it all in one folder.Or, you can just do Load [whatever you are loading eg. bitmap of music] "/[name of folder media is in]",[number]

demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 8th Jan 2008 21:34
just use a relative path; put the media folders into the same folder as your .DBA and then use



etc.

"A West Texas girl, just like me"
-Bush
Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 9th Jan 2008 01:20
Ah, thanks guys.

RIP Max-Tuesday, November 2 2007
You will be dearly missed.
Yodaman Jer
User Banned
Posted: 9th Jan 2008 02:34 Edited at: 9th Jan 2008 02:52
This question isn't dumb. In fact it's a quite common problem newcomers have. If you can't get your media to load from this type of code:

Load object "example.X",1


then try using a full filepath. Just do this for your beta test, try to figure out the other way for the full version later. Anyway:

Load Object "C:\documents and settings\desktop\file of your choice\model.X",1

If you want to make an installer for you game this could actually end up being the final code:
Load object "C:\program files\thegame\models\model1.X",1

TIP: Just so ya' know, X files can store texture information. Just be sure to export in the same file as the texture you used, other wise it will show up white in DBC/DBP.

EDIT: I misunderstood your original post, thusly resulting in making my post look odd, because I point out three ways to load an object while the obvious choice one was posted already. Sorry!
EDIT EDIT: I also just noticed that you joined a while ago . . . so you're not a newcomer. *more embarrassment*
Sorry!

Yodaman Jer

*slinks away from computer while hiding face in embarrassment.*



The Bunnies are coming . . and only one man can stop them.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Jan 2008 15:00
Quote: "try using a full filepath"


Sorry Yodaman, but I have to disagree with you there - especially if you intend to give something you have written to other people.

For example, if you have the file model.X located in

C:\documents and settings\desktop\file of your choice\

Then when you pass your game to someone else, that .x file won't be there. (Using the desktop isn't advisable either - even though you may only have used that as an example).

You are much better doing what demons breath says and keep media in a folder inside your project directory and keep all path references relative.

At least that way, Build Final will always work!

TDK_Man

Yodaman Jer
User Banned
Posted: 10th Jan 2008 18:48
I completely understand TDK. But using a full file path is how I test to see if my game models work in all of the ways that I want them to. I guess I should've mentioned that...whoops!
However, I guess using all of my media in the same folder would be ten times more efficient, heck, it could even possibly speed my games up!



The Bunnies are coming . . and only one man can stop them.

Login to post a reply

Server time is: 2025-06-02 09:48:54
Your offset time is: 2025-06-02 09:48:54