Hmmm... Will that work, Byteemoz?
I mean, the whole reason I wanted to check that the file exists FIRST is because loading a file that doesn't exist seemed to crash the game.
Anyway, I can tell you didn't run your code because your function is written to accept 3 variables, and your call to the function only uses one long string. :P
(I had the same idea, though, after I posted. :P )
Here's what I've got currently:
I guess I'll try it your way and see if it works. It does seem more direct. I'm just worried about causing another Unhandled Memory Exception!
I mean, the whole reason I wanted to check that the file exists FIRST is because loading a file that doesn't exist seemed to crash the game.
Anyway, I can tell you didn't run your code because your function is written to accept 3 variables, and your call to the function only uses one long string. :P
(I had the same idea, though, after I posted. :P )
Here's what I've got currently:
Function dynamicLoadImage:TImage(imageString:String) Local image:TImage If FileType(imageString)=1 Then image = LoadImage(imageString) Else image = LoadImage("graphics\null.png") EndIf Return image End Function Local BackgroundImage:TImage BackgroundImage = dynamicLoadImage("graphics\stage" + Level + ".png")
I guess I'll try it your way and see if it works. It does seem more direct. I'm just worried about causing another Unhandled Memory Exception!