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 / Showing Whats loaded

Author
Message
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 26th Nov 2008 18:36
Ok so what i hate is when my game is loading up and it's just black and i have seen people make it say like "loading...." and then say what object/sounds/textures exc. is loading but i don't know how

btw i was going to put this with the other post but u can't edit names oops
Irojo
17
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 26th Nov 2008 20:41
Well sadly, you have to input all the text. For example, you would do this:

box 300,200,310,220
center text 320,240,"Loading Maps"
cls
`Load file here
box 320,220,330,240
center text 320,240,"Loading Maps"
`Load file here


I download memory.
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 26th Nov 2008 21:34 Edited at: 26th Nov 2008 21:50
Here's some real basic code for *drawing* a progress bar as each percent is loaded. Obviously you need to modify this for your particular situation.

Please note: Although the wait command is used, don't actually use it when doing the real progress bar, its only used here so you can see a demo of the bar working

Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th Nov 2008 23:33
Steve:

Well yes there a way to draw one but the problem still persists to show the actual progress

Irojo:

Yes i was afraid of that
haha thanks guys
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 28th Nov 2008 00:38 Edited at: 28th Nov 2008 00:41
If you were reading a file and you wanted to know how much was loaded, I guess you derive the percent by keeping how many bytes have been loaded (say a variable called bytes_loaded#) and the file size(filename or variable goes here) command



So you just replace file_size# = 10000 with



This snippet doesn't present a complete solution as you should aim to understand reading files, combine it with this basic idea, but adapt it to fit your situation.

Check out TDK's tutorials for help with reading files

http://forum.thegamecreators.com/?m=forum_view&t=96084&b=7
Irojo
17
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 28th Nov 2008 15:16
Caleb-

It just occured to me, that you could use arrays or data statements to load it!
Although showing what you are loading wouldn't work, unless you wanted a very slow running program
For example:



Then you could do another for...next loop, displaying that it is now loading music, etc.

Obviously this loading bar doesn't look nice, but you could make it look nice.


I download memory.
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 28th Nov 2008 17:58
oh i see thats a good idea man thanks
steve paul thomas
16
Years of Service
User Offline
Joined: 4th Nov 2008
Location: United Kingdom
Posted: 28th Nov 2008 18:47 Edited at: 28th Nov 2008 18:50
Also you could implement real basic progress quite easily. Just count the number of items to load and do a basic:



On each iteration of your loop.


Quote: "Obviously this loading bar doesn't look nice, but you could make it look nice."


You're welcome to use/mod any of the drawing code that I posted. You could add some coolness to it by making the blue fill a gradient - or if you're feeling clever maybe a picture or animation.

If you don't fancy doing a progress bar. You could also have an animation or picture of one of your characters with the "Loading...Music" text underneath them.

Well the possibilities are endless really...Hopefully you have some ideas whizzing about your head now. Good luck with you game
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 28th Nov 2008 23:38
ya i see what you mean uuuugggghhhh i don't have a huge internet connection (only a average 20 kb/s download) and i'm trying to download maya trial :/ (688mb) gr haha
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Nov 2008 03:30 Edited at: 29th Nov 2008 03:37
Here's a basic example...

If you want to show the user what's being loaded you have to interrupt the program to do it, so keeping to a vague idea like I have is best or else you'll slow the computer down.
As for giving an accurate percentage, you could use FILE SIZE() to check the size of all the files your where going to load beforehand and then count them off as you loaded. Seems like a lot of work for little return though.

I'll throw in my statistic bar tutorial too...


A small program that works is better than a large one that doesn't.

DBC Challenge Rank: Rookie
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 30th Nov 2008 00:32
ok well i have to rearrange my whole code

Login to post a reply

Server time is: 2025-06-07 17:23:15
Your offset time is: 2025-06-07 17:23:15