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 / Problem with illeagal image number

Author
Message
Mr X
18
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 22nd May 2006 17:15
Hi all.

I got a problem with my game. When I try to create an sprite of one of the images, the compiler complain over that the image number is illeagal. The image number is 501, so it shouldnt be any problem as I see it. But still it complains. What am I doing wrong?

The code that set the values of the variables the images is stored in:

The function that create the image of the weapon:

The functions that make the sprite:
Mr X
18
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 24th May 2006 13:45
Ok, here is the entire source code (didnt want to post it before since its very long; 885 lines). Do you see whats wrong?

Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 28th May 2006 06:31
in the functions that make the sprite what is the variable w because unless it is constanted as somthing w=0 inside those functions making it so you are using an array 1,0 in which the array would = 0 and you would have an illegal image number
Mr X
18
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 28th May 2006 20:55
Well, I did change the function from this
to this
. But it didnt work . Then I tried something else, but still it didnt work (I added this:
in the code at the top). Any other ideas?
Mr X
18
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 31st May 2006 14:47
No ideas? Not a single one?
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 2nd Jun 2006 01:14
Instead of using fixed hard coded values you should create a function that will get a free image for you. Then you can save it in that array to hold the value. This will help a lot and It would be something like this.



NARUTO IS THE NINJA.....not really
[url=http://forum.openmmo.co.uk/index.php?topic=328.0]
WIP...4 Elements
Nul error
19
Years of Service
User Offline
Joined: 12th Aug 2005
Location:
Posted: 2nd Jun 2006 12:26
Just dont use that function within another function, I found it eats up memory like mad.
Mr X
18
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 2nd Jun 2006 17:43
Slayer93, sorry, but I dont understand what you mean. Can you explain more closely I would be vary gratefull.

Thanks for the warning Nul error. Ill keep that in mind.
Nul error
19
Years of Service
User Offline
Joined: 12th Aug 2005
Location:
Posted: 2nd Jun 2006 17:52
Your welcome, I noticed it since I was using ric's text over sprite function and relized my memory counter was dropping over time.
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 3rd Jun 2006 00:50
What the function does is get the next free image to use.

so in this part



you can change it to this



it won't interfere with any other images unless you make the next image the same as this one so use this for every image you make storing it in arrays for later use. Hope thats clear enough

NARUTO IS THE NINJA.....not really
[url=http://forum.openmmo.co.uk/index.php?topic=328.0]
WIP...4 Elements
Mr X
18
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 3rd Jun 2006 18:44
Thanks. It wont crash now at last, but the ripper has no image sp nothing happens (which is a progress in my eyes, so this is how I look now: ). Ill try to fix it myself first.

Login to post a reply

Server time is: 2024-09-25 01:35:38
Your offset time is: 2024-09-25 01:35:38