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 / My Application Keeps Crashing!

Author
Message
thelighgod
8
Years of Service
User Offline
Joined: 10th Oct 2015
Location:
Posted: 1st Apr 2016 23:02
Help my game crashes when I try and run it.
Sorry it is in german


set Dir "BESCHAFFENHEITEN"
Load bitmap "MENÜ.BMP",0
if spacekey ()=1
Load bitmap "KONTROLLEN.BMP",0
Wait 3000
endif
Set text font "Chiller"
Set text size 30
Print "Sie gehen den Weg zu einem alten Science Lab nach unten."
Print "Wollen Sie die Science Lab eingeben?"
if spacekey ()=1
Print "Du hast eingegeben..."
wait 3000
endif
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 4th Apr 2016 20:32
Do you get an error message? Can you isolate the crash to a particular line?

Does dbpro support special characters like ü in file and path names?
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 4th Apr 2016 22:15
I would think that the code isn’t crashing, but simply falling through (exiting as quick as it opens). Try putting a Wait Key at the end of your code.
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 4th Apr 2016 22:56 Edited at: 4th Apr 2016 23:01
I just did a quick test on that Ortu and it works fine here, I did use a blank bitmap at first and this did give back an error message detailing it could not load the bitmap, but after just drawing a line on the bitmap and saving it, it ran fine.

thelighgod If your bitmap image is fine (not like the one I just mentioned ie it has been edited and saved) then your program isn't actually crashing at all. As code runs from top to bottom you haven't included any form of loop within the code or actually wait for any user input. The program simply gets to the end and just ends which is normal. This is what happens:

The first two lines are fine, but then you have the if condition to detect if the space key is pressed. As this is not in a loop the user simply does not have time to press it, so the next bitmap does not even get loaded. The program continues then to the next lines which it actions normally. Once it gets to the next if condition it simply continues past it to the end so your text doe not even get output to screen as once again there is no loop for it to sit within. Once it gets to the end there is no more code so the program simply quits.

Now with that last if condition you could opt for the program to wait for user input rather than a loop, but I am unsure what you wanted to do with the first if condition. Perhaps you could explain what you expected to happen there so that we can best advise you further. In the meantime let us look at the non graphical stuff in your code, using the basic method of labels and the input command you can achieve what you require like this:



I hope that helps, I am not to good at explaining things - least of all when there is the possibility of a language barrier! Hopefully if you consult the help files and read through that code then things will be self explanatory. If not then just ask away about anything you don't understand, it could well be that other users here can explain this much better than me

Edit: apologies WickedX took me a little time to type that up while you posted but yes I think providing the bitmap issue I mentioned isn't what's crashing it then what you state is what is happening
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 4th Apr 2016 23:05 Edited at: 4th Apr 2016 23:17
No Problem, James. Would have never known about the bitmap issue. I don't use bitmaps.
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 4th Apr 2016 23:35
Quote: "I don't use bitmaps"

Me neither lol, ditched them right at the beginning of learning DBP, only just found out now while looking into what Ortu suggested because when I was working out how a project from Dark Source was doing Katakana translations with odd looking strings, that wasn't either a direct translation nor katakana symbols (after MrValentine was querying it) I came across what Ortu suggested, so what he was suggesting was entirely plausible given that its the second line of code
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 4th Apr 2016 23:46
So it's a character set issue. Thank you for clearing that up. Its been a long hard day.
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 5th Apr 2016 01:00
Nooooo! Lol - it is exactly as you had said(unless the OP used blank bitmaps to get things up and running - in which case its both the bitmap problem and what you stated as well), I was just pointing out that initially I was testing out Ortu's suggestion as it was plausible based on previous findings while playing with katakana In this case the character set was just fine but some character sets may not be. I did make a poor explanation so it's not just your long hard day
thelighgod
8
Years of Service
User Offline
Joined: 10th Oct 2015
Location:
Posted: 1st Jun 2016 17:09
Thanks guys

Login to post a reply

Server time is: 2024-04-23 23:34:02
Your offset time is: 2024-04-23 23:34:02