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 / Why am I getting "Image number illegal"?

Author
Message
Laski apina
15
Years of Service
User Offline
Joined: 5th Sep 2009
Location:
Posted: 6th Sep 2009 12:04 Edited at: 6th Sep 2009 13:05


In the FOR...NEXT the variable "a" gets to 2 and then crash and error message.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Sep 2009 13:22
You only have 3 images - 1,2 and 3. Any image number above this will be illegal. All of your clauses in the last loop request image numbers >= 10.

Laski apina
15
Years of Service
User Offline
Joined: 5th Sep 2009
Location:
Posted: 6th Sep 2009 13:29
I fixed the crash, but now I notice that my cloning isn't working.

So I have 3 pictures, but I need 10 sprites and every one of them to have pic1, pic2 and pic3, because I need them to show at the same time.
Now when I use SPRITE blahblah, all I get is a white dot when I try to use the CLONEd ones.

How am I using CLONE the wrong way?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Sep 2009 19:09
I'm not sure why CLONE SPRITE isn't working for you but you don't need to clone sprites since the SPRITE command will do just that and place the sprite where you want it at the same time.



Also there's no need to use SET SPRITE to replace the background and consider black a transparency since those are the default settings for every sprite. And put a ,1 at the end of all GET IMAGE commands so the image isn't blurred.

Colonel_Klink
17
Years of Service
User Offline
Joined: 20th Dec 2006
Location: Within the dark recesses of my mind
Posted: 7th Sep 2009 04:17
I've been caught out on this several time too. Perhaps
the "Image number illegal" warning could be easier to debug if the warning was something like "Image [or object] number [actual number here] has not been allocated".

Oh my gosh! He's wearing Full Metal Pyjamas!
--------------------------------------------

Login to post a reply

Server time is: 2024-11-24 01:34:27
Your offset time is: 2024-11-24 01:34:27