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 / Image does not exist error

Author
Message
imma newb
13
Years of Service
User Offline
Joined: 3rd Feb 2011
Location:
Posted: 9th Feb 2011 15:30
I am new to dark basic, and I'm having an error that really makes me confused. So i came on here for help from all you DarkBasic Pros

For some Reason a message says image does not exist on line 240 which is my do loop

do
If scancode()=0 then exit
loop

i dont know why it says that, if anyone can help that would be much appreciated.

Gangstar
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 9th Feb 2011 16:46
1st off, welcome to the forums!

As far as the error goes, it seems pretty clear that it's NOT on line 240. DarkBASIC has a tendency to hit an error and then skid to a halt a few lines later. Go to your last image based command above it (perhaps LOAD IMAGE or even SPRITE or something similar). Are you using valid image numbers? Does the file exist in the same folder as your code file?

Hope this helps

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
imma newb
13
Years of Service
User Offline
Joined: 3rd Feb 2011
Location:
Posted: 11th Feb 2011 15:50
haha Thank you

And Yes that did help Thank you alot.. Dark basic is confusing. haha

Gangstar
imma newb
13
Years of Service
User Offline
Joined: 3rd Feb 2011
Location:
Posted: 14th Feb 2011 03:23
Well Now. I found the problem and attempted to fix it now it says on the Line 0 that Object already exists. i changed the objects number name so it wouldnt match any of the other Objects.

I am a little confused right now Help would be much appreciated. oh also. Dark Basic IS SO AWESOME! i went to go see all the games made by Dark basic and WOW! I am Inspired

Gangstar
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th Feb 2011 09:26
Without code, it's hard to offer specific help, but here's a quick explanation:

Think of object numbers as house numbers in an address. When you use any command that references it, such as MOVE OBJECT, the computer essentially goes to that house and alters the object's data (in this case it would be it's position). If two houses had the same address, that would be impossible to manage (since you couldn't control either individually). Thus each object must have a unique number.

A good trick to do this is to use variables. For instance



This is a simple example, but if you were to put the variable declarations (objball=1, objbox=2, objtriangle=3) at the start of the program, then you would never have to find all of the commands in the rest of the code if you needed to change an object's number during development (it happens sometimes). You would just have to go to the line that says objball=1 and change it to objball=25 or whatever the new number would be.

Also: glad to see you're enjoying it! If you want some good tutorials to get a handle of the basics, TDK's tutorials (they're stickied at the top of the forums here) really helped me out in the beginning. They're really well written and cover a lot of the most common commands/tricks that you will use in programming.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
imma newb
13
Years of Service
User Offline
Joined: 3rd Feb 2011
Location:
Posted: 14th Feb 2011 15:08
Haha I just recently found those TDK tutorials. haha I dont know how to show my code on here. Sorry I'm really new to this.

Gangstar
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th Feb 2011 19:30
It's cool, just copy and paste it into the message here. Then highlight it and click on the "code" button. That will put in the code tags, making it a snippet like what I posted before.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
imma newb
13
Years of Service
User Offline
Joined: 3rd Feb 2011
Location:
Posted: 15th Feb 2011 15:01
oh I see. Haha Thank You.

Ok here is my code

Gangstar
imma newb
13
Years of Service
User Offline
Joined: 3rd Feb 2011
Location:
Posted: 15th Feb 2011 15:14



This is just the Top half of my Game. hope this works

Gangstar

Login to post a reply

Server time is: 2024-04-19 06:54:41
Your offset time is: 2024-04-19 06:54:41