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 / Adding multiple media files before making an exe

Author
Message
jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 22nd Mar 2008 23:58
I cannot see how to add multiple .wav and .bmp files - I'm having to add each in turn, a lenthy operation with 10 or so!
Am I missing something please?
Paul08
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location: Oxford, UK
Posted: 23rd Mar 2008 00:18
AFAIK in the standard ide its just a boring laborious way of doing it..

or open the .dbpro file up in notepad and find something around:
; **** External Files Information ****
; **** Media ****
media root path=
; example entries: media1=graphics\*.jpg

think you might be able to add it in there??

Paul
Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 23rd Mar 2008 00:26
yeah as far as I know, u have to add them one by one ... it's nasty ... I myself have to do it this way too ... and I have over 500 media files

Could you help me treat my injured Dino-Fly ?
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Mar 2008 00:30
you will have to add one by one all the media files you need for your game or just make a normal exe and put all texture ...wavs...and so on inside the main game folder.

cheers.

oh my god
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Mar 2008 07:10 Edited at: 23rd Mar 2008 07:31
Quote: "Am I missing something please?"


Yes you are!

Put all the media files you want to include into a folder in your project directory called say 'Media'.

Then, in the default IDE, click on the blue Media button and then the Add button.

When the box appears, select the type of media in the top right corner (Eg: 2D Image Files to add jpg files), and then navigate to your Media folder.

Select just one of your jpg files.

Next, go to the path and filename box at the bottom and scroll to the end of the line. You should see the jpg filename you clicked on.

Alter the filename.jpg so it says *.jpg and click on OK.

You should now see Media\*.jpg on the list in the top right corner.

Repeat for BMP files and all the other media types you want to add.

Note: I think there were problems doing this with earlier versions of the IDE, so if the above works but the files aren't actually included at compile time, then check to see if you have the latest version of the IDE.

I'm sure I've done this in the past, so I'm checking it out now.

[Edit] Yes - it works perfectly...

TDK_Man

jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 23rd Mar 2008 18:06
Thank you TDK.
My Help About says I am using Version 1.067, but if I hover over the file name, it says File Version 1.0.9.1 created 4/11/2007.
Is that the latest version please?
As you said, *.bmp etc does not work, even though the box says Wild Cards accepted.
I downloaded Version 1.09 which defaulted to C:\program Files\Dark Basic Software\Dark Basic Professional\Editor rather than C:\Program Files\The Game Creators\Dark Basic Professional\Editor as last time I upgraded. It would not run from there, saying it can't find dbp_config.dll.
I'm confused...
Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 23rd Mar 2008 20:50
woww this was helpful !!! thanks TDK !!!

Could you help me treat my injured Dino-Fly ?
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Mar 2008 22:01
Quote: "Is that the latest version please?"


The default IDE version is different to the version of DBPro. My editor version says 1.063, but my version of DBPro is 1.066.

I think that now, you upgrade the IDE separately to the complier - and there can be problems with the version displayed after you have upgraded.

Anything that says 1.063 or later should be OK I think.

TDK_Man

jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 24th Mar 2008 11:28
Hi,
I'm not getting anywhere!
Have downloaded the latest DBPro (version 6.7) which went into Game Creators sub directory..
Editor.exe in directory Dark Basic Software .. shows 31/12/2007 as the date created.
*.bmp etc still does not work.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 24th Mar 2008 13:40
I would back up my projects folder and un-install DBPro, then delete the DBS and the TGC folders. Finally, reinstall DBPro - which is these days located in the TGC directory.

I know it's a pain, but I can think of no other way around it because having the editor in a different directory to DBPro doesn't sound like a very good idea.

It may or may not be the cause of your problem but until you try, you'll never know...

TDK_Man

jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 24th Mar 2008 23:55
I did as you suggested TDK - thanks.
However... having upgrade to DBPro Version 1.067, and using the default IDE, the .bmp system still did not work.
Just to recap:-
I put 2 bmp files in C:\Program Files\The Game Creators\Dark Basic Professional\Projects\movessss\media, with the dba file in C:\Program Files\The Game Creators\Dark Basic Professional\Projects\movessss.
Then clicked Media add, and got a long thin box "select media file to include".
I navigated to the media folder, selected one of the .bmp files, and changed the name to *.bmp. I could go no further, as "Open" did nothing.
So I left the full .bmp name in, pressed open and got back to the long thin box, now with the full name in.
I altered that to show *.bmp, clicked OK and got media\*.bmp in the right hand box "media to include in exe".
I compiled using "exe with attached media", moved the .exe file to a different directory to test it, ran it and got "could not load image".
Help!
compiler.exe still shows file version 1.0.0.5 and editor.exe shows 1.1.0.1 as before the upgrade.
Sorry about the long query...most frustrating.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Mar 2008 04:25
Just to double-check I just followed the process I outlined above after converting all the jpg files I had to bmp and it worked perfectly.

Please post one of the lines from your program which loads one of the included images - I'd bet money on the fact that your problem is there!

And don't forget that the IDE upgrade is a separate download:

http://darkbasicpro.thegamecreators.com/?f=ide

But, I just checked my IDE (Editor.exe) and it says I'm only using V1.0.6.1 (must have forgotten to update it when I last did an install).

TDK_Man

jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 25th Mar 2008 10:25
I now have ide editor file version 1.0.9.2 (I did upgrade to 1.0.9.1 first as the webpage advises). Still does not work.
The line which loads the bmp which won't load is
"load image "ladybird.bmp",numofsprites+1" where numofsprites has previously been set to 8.
The programme works fine when I do not include bmps.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Mar 2008 11:41
Quote: "The line which loads the bmp which won't load"


Ahhh... so it's not a case of not being able to include multiple bmp files then - it's one bmp that won't load?

Load that bitmap into a paint program, save it with a different name, delete the original and rename the new one using the old name.

And I strongly suggest that you put all your media into a folder called Media and use:

Load Image "Media\Filename.ext",ImgNumber

If nothing else, you can then follow the step by step instructions I gave above - because I assure you that it works.

In fact a very easy way to check if the media files have been included is to compile the program without any included media and note the filesize.

Then use the *.bmp to include the files and compile it again. This time the compiled exe should be bigger. If it is then the images have been included and if it's the same size then it didn't work.

TDK_Man

jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 25th Mar 2008 13:30
SUCCESS!!
The right thing to do, in hindsight, is to (as you said) put all media in the media\ folder.
Then put Load Image "media\filename.bmp",ImgNumber (etc) in the dba file.
Now that's over, I need to find a way to save the list of media\*.bmps etc so that there is no need to load them up in a new session... asking too much?
Many thanks again for your help.
Paul08
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location: Oxford, UK
Posted: 26th Mar 2008 16:14
Yes, the project file you've done this in, open it in notepad.

Look for:

; **** External Files Information ****
; **** Media ****
media root path=
; example entries: media1=graphics\*.jpg
media1=C:\Program Files\Dark Basic Software\Dark Basic Professional\Media\water.bmp
media2=C:\Program Files\Dark ..............

Just copy the media1= ..... media2= ...... etc etc and paste it (in notepad) into your new .dbpro file / project file.

Save it, and close it, then reopen dbp and open your new project and the media should get attached/included??

Paul
jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 7th Jun 2008 13:24
To TDK and others,
I was premature when I thought I had been successful in creating a stand-alone exe - sorry!
I have followed TDK's instructions dated 23rd March, until "When the box appears, select the type of media in the top right corner (Eg: 2D Image Files to add jpg files), and then navigate to your Media folder..".
I don't have a media type selection, only an "open file" icon to the right of a narrow box. Clicking on that allows me to navigate to the media directory, AND choose the file type.
The rest was the same as advised.
F4 to comile doesn't give a stand-alone exe.
If I don't choose stand-alone, the prog runs fine, ie the prog itself is OK. I only have the 1 type of media.
What IS going wrong??
jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 7th Jun 2008 13:32
The stand-alone file is 9.8 Mb long, and the ordinery one is 2.3 Mb, so stand-alone is being actioned OK.
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 7th Jun 2008 15:27 Edited at: 7th Jun 2008 15:29
These are the options you should get in the add media screen (example from my project)
You can select media type or use All files and simply select each relevant folder (textures in the example)

Attachments

Login to view attachments
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 7th Jun 2008 15:29
And what you could have after selecting everything you need

Attachments

Login to view attachments
jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 7th Jun 2008 19:43
Thank you folks.
It would seem from the pics provided by Scorpyo that I do not have the latest editor.
I've tried to update mine before, but:-
1. How do I find out what version I have?
2. Where do I get the latest version - presumably of editor.exe and compile.exe?
3. The help in the IDE shows version 1.067. Is that the compiler version or the IDE?
4. Is version 1.067 the same as version 6.7?

As a simple country boy, I do find the numbering/help system most confusing....
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 7th Jun 2008 20:00
quick way to check is to see if in tools if the options box gives you the options to use concatenation symbol. plus it will have 10 tick boxes.

Dark Physics makes any hot drink go cold.
jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 7th Jun 2008 22:42
Hi all,
I've done as WindowsKiller said, and updated DBPro carefully and put the patch in (ie used your editor.exe).
"That crappy media-adding dialog" is stil there...
Help About in the IDE now shows DBPro Version 1.068
To HowDo, the systems options tab now (as before) has 10 tick-boxes, the last one saying "Enable Source Line Concatenation Directive". Is that the one you mean, so that I now have the latest IDE - how can I prove that is the case??
Do I use the Project Summary, blue Media tab etc again? I have tried and it doesn't work!
To Scorpyo, I don't get the same view as in your AddMedia2.jpg picture (File Display Filter).
How do I check what IDE version I have?
Thanks for all efforts folks.
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 7th Jun 2008 23:03
Check the editor.exe file

ver 109b = 896 KB - Oct 29,2002
ver 1103 = 2003 KB - March 20, 2004
ver 1104 = 2003 KB - May 27,2008

Dates may not correspond tho, but size will
The list goes from oldest to newest
I personally still have and prefer 109b
jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 7th Jun 2008 23:14
Yes, I have ver 1104 and it is 2003 kB long.
jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 10th Jun 2008 20:19
Hi again.
I have simplified my prog to show my problem, attached.
Putting the 3 wav files in separately, the exe works perfectly, even if I rename the first file to acceptable1.wav.
When I try to use *.wav as explained above, no joy. It fails on "Could not load sound at line 1".
I have compiler version 1.068, and the latest editor, with WindowsKiller's patch for the IDE, as explained above.
What is going on??

Attachments

Login to view attachments
jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 11th Jun 2008 23:11
What is "Enable Source Line Concatenation Directive"?
It looks like you have all given up on me...
but in case that is not so, I give below my actions to try and make a stand-alone exe (I want to load 84 wav progs, so putting them in one at a time is impracticable).
In the right hand box labelled "media to include in exe"
1. Click "add" - this brings up a narrow box called "Enter the name of the file to include in your application (wild cards are acceptable)"
2. Click the open file icon to bring up a browse box.
3. Navigate to the test directory, choose wav files, this brings up the 3 wav files.
4. highlight the first one - it appears in the filename box.
5. Click "open", and the narrow box referred to above now says
C:\Program Files\The Game Creators\Dark Basic Professional\Projects\test\acceptable.wav
6. Overwrite this to show
C:\Program Files\The Game Creators\Dark Basic Professional\Projects\test\*.wav
7. Click OK
The right hand side box called "Enter the name of the file to include in your application (wild cards are acceptable)"
now says *.wav. Also the red "settings" button shows that an "exe with attached media" is set.
8. Press F4 to make the exe. It is 1.412 Mb long. It is the same length as a "normal exe" ie not a stand-alone one - is that a clue?
9. To test that the exe is stand-alone, I now rename acceptable.wav to acceptable1.wav
10. Run the exe. Result - Runtime error 3002 - could not load sound at line 1.

FAILED AGAIN. Can anyone help please? The files can be downloaded in my last post.....
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 11th Jun 2008 23:20 Edited at: 11th Jun 2008 23:20
The line concatenation bit allows you to specify a sequence of characters that let a line span more than one display line. Usually, this is '...' like so:

a = b + ...
c

Overly simple, but hopefully you get the idea.

I never use wildcards at all, and I never use the browse button, either. I type the filename in myself. That works fine for me. I will try your code...gim'me a few minutes.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 11th Jun 2008 23:38 Edited at: 11th Jun 2008 23:43
Its not acceptable.wav that is the problem, its accidentally.wav

That happens when you concatenate lines in that way. (Which is different from the concatenation I mentioned above, too...btw)

Also, try this code instead. You need to wait a few ticks before playing the sound, otherwise, you will lose the first few ticks of the sound. Weird, but true.




Also, I deleted the media files, and typed the names in myself, then pushed the OK button. I must not be as up to date as the others, but...this works for me.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 12th Jun 2008 00:17 Edited at: 12th Jun 2008 00:35
Timo, stop it. If you concatenate the line, the error message referring to line 1 is ambiguous at best. Knock it off!

There was nothing arbitrary about the statement. If you don't understand it, that's your issue. This is what I mean when I refer to hamstringing the complier...in this case, you are hamstringing the error reporting facility, which does not distinguish between the two statements.

If the statements were on separate lines, the error would have referred him to the issue, which is that the LAST file was not getting added....look at his code he posted...it doesn't have accidentally.wav at all.
jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 12th Jun 2008 00:56
To WindowsKiller - yes, "He shouldn't try to use wildcards any longer, even if it will result in more work, and his problems are gone."
The prog works OK when putting the wav files in 1 by 1.
However, trying to add 84 wav files that way is not on! (This last comment to jinzai also).


Perhaps TDK can enlighten us as to how he produces a stand-alone exe using a wildcard, when no=one else appears to be able to do that?
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 12th Jun 2008 01:26 Edited at: 12th Jun 2008 03:16
Tell you what...this problem has plagued you long enough. I will write you a program to add all of the files in a directory into the .dbpro file according to the extension you give it.

That is about the same effort that you are looking at now, and it would be useful for anyone that wants to do that. What do you think?

EDIT : This mouse is frustrating...flat roller. The other one is dead, too. Guess I need to spend more than $8 next time.

Here is a way to add all of the sounds to a project file. It is very contrived, but you can add your sounds using it. It will not change the EXE type to media, but that's already the case in your app. Put the executable created by this source file in the project directory. It will create a project file with the name addwav.dbproject You can rename it to the proper name and it should work for you.

Apparently, the media folder is required, like spooky said...THANKS, spooky. This does not require that, however. It worked on my system, anyway.

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 12th Jun 2008 01:29
I have never had a problem with wildcards just like TDK.

One thing is to note that wildacards don't appear to work on files in same location as exe, so media needs to be in a subfolder of project directory, such as 'media'.

Imagine in my project folder I have the .dba and .dbpro files and a folder called 'media' with loads of .png images.

My program has commands such as;



To make dbpro include all png images using wildcards;

a) Click 'media' blue button, then 'add' and MANUALLY type 'media\*.png' in box.

b) Click 'settings' red button and make sure radio button 'EXE with attached media' is selected. Optionally tick the compress and encrypt boxes.

Compile as normal. You should know if everything worked as EXE size will be different. Copy just the exe to another folder and it should still work.

Boo!
jayell leedham
18
Years of Service
User Offline
Joined: 24th Jan 2006
Location: North Yorkshire
Posted: 12th Jun 2008 20:12
Many thanks for replies.
Spooky's method worked fine, so I won't need to input 84 wav progs individually!
The dba and dpro files needed to be in a projects\words directory, and the media files in words\media. Didn't work when the directories were straight off the C: root.
Thanks jinzai for your programme which I have not needed. You were very quick to write it, which I admire.
Over and out.

Login to post a reply

Server time is: 2024-11-25 23:49:07
Your offset time is: 2024-11-25 23:49:07