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 / Load Bar Function

Author
Message
Jess T
Retired Moderator
22
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Nov 2003 09:33 Edited at: 4th Nov 2003 11:48
[EDIT] Problem solved... See below for details [/EDIT]

Ok, i have a load bar function which displays a bar and the percentage loaded, but, every time i need to execute the function, my program just ends... I don't know why.

I had it working fine and then i changed some code in another completely different part of the program and the load bar function just started to end my program... please help.

Here's the function:


Thanks In Advance...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Jess T
Retired Moderator
22
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 3rd Nov 2003 13:45 Edited at: 4th Nov 2003 11:49
[EDIT] Problem solved... See below for details [/EDIT]

Ok, I figured out what my problem is... But... I don't know how to fix it still..
The problem is with the sync command at the bottom...

I don't know why, but everytime the function is executed and sync'd, it just acts as though there was an End command there.. It's very strange...

I can take out the sync command, and it works fine, but i can't see anything, hence my dilema...

Thanks to those who help, name goes into the credits for the effort (Just an insentive to get some people to actually post a reply, lol)


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Nov 2003 14:29
Basically you haven't actually found the problem ... it sounds to me like you might have dodgy model loaded or something similar.
DB Maniac 164
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location:
Posted: 4th Nov 2003 00:28
could be, ive had dodgy mp3s that play fine in Win media player but DBPro/DBC hates them. One Tip, avoid using sync in loading sequences.
I once made a sad excuse of an rpg map maker that detected and loaded a list of bmp tiles. when I loaded them i had a loading bar with the sync to update the bars state and it slowed the program down when loading. I removed the bar and sync and the images (Even thousands) loaded quickly, however with the sync, the program can only load 60 images a sec at max. ditch sync (and subsequently the loading bar)

GameCube XBox PS2 N64 Dreamcast Mega Drive SNES NES GBASP Master System Speccy 128 +2 Commodore 64 Atari 2600 Atari Jaguar Mega CD 32-X Atari Lynx, Jees is there any I Don't Have?? (F-Zero GX Rules!!)
zircher
23
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 4th Nov 2003 03:23
Or, only call the loading bar function every now and then...
Jess T
Retired Moderator
22
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 4th Nov 2003 08:21 Edited at: 4th Nov 2003 11:49
[EDIT] Problem solved... See below for details [/EDIT]

@IanM, no, i don't think that that's it.. thanks anyway...

@DB_Maniac_164, but without the sync command im left with a few moments of black screen where there should be an increasing bar going across the screen.

@zircher, But it's this function that is crashing the program... and i still can't figure out why...

Here's everything that i have (up the the first time that the load bar function is called):




That won't really run without the images, but if someone could spare 10 minutes to go over the code, i'd much apreciate it...

It's when it get's to the first load bar function call... It just ends the program... as if there was an End command.

But, when i take out the Sync command at the end of the load_bar function, everythign works fine, but you can't see any of the load bar...

This is so frustrating, because it was working fine, then it stopped... arrrggg...

Thanks aging to those who have helped/help...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 4th Nov 2003 10:37
Hi JT.

There are several problems I can see in your code:

Firstly, the commands SYNC ON and SYNC RATE 0 appear more than once in your code. They don't need to. Just set them once at the start of your code and the sync rate will remain set.

On the same subject SYNC appears on several occasions also. It doesn't need to. Just keep the SYNC command at the bottom of the main loop and lose the rest.

'_initialize_world()' - Your rem statements say that this functions sets everything up and yet you never call it because the code gets locked up in a DO LOOP inside '-menu_start' - so nothing gets set up.

However, if you were to call '_initialize_world' then the program would end as you are saying it does because as soon as the code returns from the function there is an END command.

If you need more help - you know where to post.

Sleep ... those little slices of death. How I loathe them! - Edgar Allen Poe
Jess T
Retired Moderator
22
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 4th Nov 2003 11:33 Edited at: 4th Nov 2003 11:48
[EDIT] Problem solved... See below for details [/EDIT]

Quote: "Firstly, the commands SYNC ON and SYNC RATE 0 appear more than once in your code. They don't need to. Just set them once at the start of your code and the sync rate will remain set."


Yeah, i figured that, and i got rid of them all just after posting and forgot to Edit the post, which is now edited...

Quote: "SYNC appears on several occasions also. It doesn't need to. Just keep the SYNC command at the bottom of the main loop and lose the rest."


Ok... I'll fix that and try it again, thanks.

Quote: "'_initialize_world()' - Your rem statements say that this functions sets everything up and yet you never call it because the code gets locked up in a DO LOOP inside '_menu_start' - so nothing gets set up."


ok, that's my fault, i didn't explain the code properly...

Inside the menu function, the user can click buttons and one of the buttons (Play) exit's the function which therefore sends the programm's play-head back to the main stuff, in which, the next call is the _initialize_world() function.

Quote: "if you were to call '_initialize_world' then the program would end as you are saying it does because as soon as the code returns from the function there is an END command."


Yes, i know, that was there so you didn't have to read through litterally 200 lines of code.
The problem is with the _load_bar(percent) function. When it is called, the program ends (inside of the _initialize_world function, at the start) ie, the function is called, and the program just stops, therefore the next command (the Autocam Off command) isn't even reached...


Although this didn't solve my problem, i am still greatful for your time Scraggle and any further help would be greatly appreciated,

Thanks To All Who Read This Thread...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Jess T
Retired Moderator
22
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 4th Nov 2003 11:45 Edited at: 4th Nov 2003 11:49
[EDIT] Problem solved... See this post for details [/EDIT]

Ok... I feel rather stupid indeed right now ...

I solved the problem.

In the _menu_start() function, when the Function was exit'd, the sprites weren't deleted, and for some reason (possibly a bug) they stopped the function that drew to the screen from working normally...

But thanks to all those who helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 4th Nov 2003 12:06
Quote: "The problem is with the _load_bar(percent) function."


No ... it is't.

I haven't found your problem yet but it is not in the _load_bar function. The code below proves that.



I am still trying to isolate the cause - bare with me.

Sleep ... those little slices of death. How I loathe them! - Edgar Allen Poe
Jess T
Retired Moderator
22
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 4th Nov 2003 12:11
Urm.. I know it's not to do with that, It's to do with syncing my function when 2D is drawn ontop of the sprites, which i believe to be a bug, but im not too sure if it just the way i have things set-up...

Thanks for your help though...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy

Login to post a reply

Server time is: 2026-07-26 16:04:05
Your offset time is: 2026-07-26 16:04:05