Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Picture not successfully created?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Srlancelot39




PostPosted: Wed Feb 01, 2012 2:06 pm   Post subject: Picture not successfully created?

I am very familiar with this error, and have been able to solve it every time up until now. Out of boredom, I decided to run my RPG to look for things to improve and when I tried to change the map scale from %50 to %100, it crashed with the error: "Illegal picture ID number '0' (yada yada yada)".

I can't figure out why it's saying this because
-The image that is causing the crash is declared directly after the image that is being displayed right before the crash, so I know it is being read in the variable table.
-I have tried copying and pasting the file name string from the variable table into the file name itself just in case there is some sort of invisible typo or character error.
-I have tried opening the file itself - it opens fine and I resaved it.
-The image was being displayed when I showed the game to a friend a few days ago (it didn't crash at all).

I have run the game in Turing and OpenTuring - the error occurs in both and I expected that.

Turing:


var mappic50 : int := Pic.FileNew ("Images/fullmap 50.bmp")
var mappic100 : int := Pic.FileNew ("Images/fullmap.bmp")

%(1481 lines of code)

Pic.Draw (mappic100, xpic, ypic, picMerge) %Error is occurring here



Please specify what version of Turing you are using
4.1 and OpenTuring

Thanks!
Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: Wed Feb 01, 2012 4:42 pm   Post subject: Re: Picture not successfully created?

Try using these before drawing the picture:
Turing:
assert File.Exists("Images/fullmap.bmp") % Check that the file actually exists
assert mappic100 ~= 0 % If the file exists, check if you have a picture id


Basically, if the first assertion fails then that's easy, Turing can't find your file. (I know you said said you copied the path but try it)
If the second assertion fails then try looking at error messages.
Turing:
put "Error Number: ", Error.Last
put "Error Message: ", Error.LastMsg
put "Error Constant: ", Error.LastStr

These must be placed before Turing halts. If that doesn't work, it might be something more subtle.
Srlancelot39




PostPosted: Wed Feb 01, 2012 4:45 pm   Post subject: RE:Picture not successfully created?

Ok thanks, I'll try that.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: