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 / Help with loading pictures -- causing program crashing

Author
Message
Mnementh
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location:
Posted: 9th Jul 2005 14:17
I'm making a simple RPG and I need help with a certain aspect of loading pictures. You see, the game includes a 'dungeon maker' aspect, and one part of that lets you enter in a path for the 2d image you want to use for a certain monster you created. Long story short, how do I make DBPro check and see if that file exists BEFORE loading it, so my game doesn't crash when it tries to load a non-existent file? (assuming you miss-typed the pathname for the monster image)

I already tried to use code that looked something like this:



--Did you know that 42% of all statistics are just made up?
thinkdigital
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 10th Jul 2005 06:49
The command is file exist( filename$ )

returns 1 if the file exists, 0 if it doesn't

eGeneric Works
Dark Basic coding site >>
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 10th Jul 2005 07:14
Use this:

______________________________________
<<<<I can program using anything>>>>
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 10th Jul 2005 07:27
or this

______________________________________
<<<<Check out my websites>>>>
www.rhettgames.tk www.marvel-us-media.tk
Mnementh
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location:
Posted: 20th Jul 2005 10:39
Quote: "The command is file exist( filename$ )"


Thanks thinkdigital, that fixed my problem.


--Did you know that 42% of all statistics are just made up?

Login to post a reply

Server time is: 2024-11-27 22:31:07
Your offset time is: 2024-11-27 22:31:07