How to check if a file is not found?

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,282
Reaction score
106
First Language
Irish
Primarily Uses
N/A
I just want to know how to check if a certain file is not found in your scene? For example, I created a sprite that shows a representation of my actor every time. I changed my actor and currently, I have no image that shows the actor's representation. Normally, it says in the console that such file is not found and an error message appears. However, I was wondering if there's a way to check if the current image needed is not found, so I can skip showing the sprite, if the image is found, display the image.


TIA.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
858
First Language
German
Primarily Uses
You will throw an error, if you request a file that doesn't exist and there's nothing in the base scripts, that would prevent it. There has to be a different reason for your actor to be invisible.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,282
Reaction score
106
First Language
Irish
Primarily Uses
N/A
Yeah it throws me an error because the bitmap isn't present. But I was wondering if there's a way to check if the bitmap is not present, so I can do bunch of stuff inside the true clause.
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,695
Reaction score
924
First Language
English
Primarily Uses
N/A
Well, if it throws an error when the file can't be found, just have a catch block to catch the error and handle it.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I was doing forge runs on D2 with my wife last night, and singing like a leprechaun to annoy her XD. I was calling it 'The Farge'
Is i possible too make a weapon have a chance of using a skill?
Can the Eternal Dreamers finish off the final boss? We'll see!
Fekken kill me. I unknowingly swapped out two important events's codes and saved the game to test it. I'm just doing this for fun and the fun has now been replaced with excruciating torture.
Is this how game developers feel all the time?

EDIT:
WAIT HOLY S***
MY LAST POST ASKING FOR HELP ON AN EVENT ACTUALLY SAVED IT
OH MY GOD
Coffee + Silk Coconut Milk + Splenda Zero = Not ..... awful :/ .

Forum statistics

Threads
94,448
Messages
921,010
Members
124,272
Latest member
lymeish
Top