Scrolling Game Development Kit Forum

SGDK Version 1 => Script => Topic started by: Nakur on 2006-10-30, 01:13:07 PM

Title: Error message: Error playing map: Subscript out of range
Post by: Nakur on 2006-10-30, 01:13:07 PM
Any idea what this error means?  The game will start up and run, but when I press control to try and swing a sword, the game crashes and that error comes up ("Error playing map: Subscript out of range").  I'll post the code if you need to see it to help... I'm sure the code is broken; I've made some massive changes over the original code, and deleted a lot of stuff that I thought wouldn't be needed in my script (or commented out stuff that I haven't implemented yet). 
Title: Re: Error message: Error playing map: Subscript out of range
Post by: durnurd on 2006-10-30, 03:46:33 PM
The code would certainly be much help.  However, since you haven't posted it yet, the first thing I can say is that you are trying to access an element in an array beyond the end of the array.  Possibly a sprite that doesn't exist yet or something of that manner.
Title: Re: Error message: Error playing map: Subscript out of range
Post by: Nakur on 2006-11-06, 12:41:55 PM
Just wanted to let you know that I did get this fixed.  As it turns out, the script I was using was checking Case 0, 2 or 1, 3 to tell if it was facing left or right and accelerating or drifting.  The sprite that I was using only had left / right cases, not left / right and accelerating / drifting cases, causing the game to crash.  Changed the sprites, and now it works great.

Thanks for your help, knowing that it was trying to check for something that didn't exist really helped with finding the problem.