Hi
I have received this message:
getSpriteAsBitmap32bit: Unable to find sprite 0
It says if you are unable to resolve the error post on the forum.
My game save will not open...so I am unable rectify any possible problem. Does anyone know how to resolve this issue so I can get my game back?
Thanks
Solution: Delete the file acsesprite (or something like that) and rename the file backup_acsesprite (or so) to only acsesprite (I won't comment it again :P ). Then try to load the game again.
Quote from: NsMn on Sat 18/07/2009 17:52:01
Solution: Delete the file acsesprite (or something like that) and rename the file backup_acsesprite (or so) to only acsesprite (I won't comment it again :P ). Then try to load the game again.
Thanks for replying, I have found the file acsprset in the game folder, however I can not find the back up file which you describe? I guess it would be in teh same place as the original file?
Thanks
After not finding the backup file in he folder I replaced the old file...
I now have a whole new error message......a 'square', hexadecimal value 0x06, is an invalid characer. Line 1, position 1.
***PLEASE IGNORE THIS SECTION THIS HAS BEEN RESOLVED****
The below error continues:
getSpriteAsBitmap32bit: Unable to find sprite 0
Thanks
What happened before you saw this message for the first time? Was there an error saving the game before it started doing this?
Quote from: Pumaman on Sat 18/07/2009 19:54:19
What happened before you saw this message for the first time? Was there an error saving the game before it started doing this?
I imported a new sprite and applied it to an inventory item, I then ran the game to see what it looked like in game. The game ran its usual loading screen and then stopped throwing up the error:
getSpriteAsBitmap32bit: Unable to find sprite 0
I then wasn't able to save the game, I thought if I reload it from the last place I saved it would be okay, but I continued to get the above getSprite..... message.
Thanks
It sounds like your game's sprite file is corrupt, though I think I've only seen this happen before where there was some sort of error saving the game, and then this message started to come up whenever you tried to load it in future.
If you can zip up and upload your game folder I can take a look, though it's likely you'll need to restore from a previous backup version.
Did you use the Send Error Report button when this message first appeared?
Which version of AGS are you running?
Quote from: Pumaman on Sun 19/07/2009 19:49:34
It sounds like your game's sprite file is corrupt, though I think I've only seen this happen before where there was some sort of error saving the game, and then this message started to come up whenever you tried to load it in future.
If you can zip up and upload your game folder I can take a look, though it's likely you'll need to restore from a previous backup version.
Did you use the Send Error Report button when this message first appeared?
Which version of AGS are you running?
Thinking about it, it may have been when I saved it? I often press save before running the game to test it.
I didn't have a back up version, so I found the acsprset file in the demo game and loaded it in. This allowed me to open my game, all the coding was still there but all the graphics had gone. So I started again added everything back in...but now I have been given the error message again! So I am not sure what I am doing but it doesn't like something! I am not sure if the resolutions are too big for the game?
I did report it the first time as AGS offered me to report the bug.
I think I am using the latest version of AGS as I downloaded it only a week ago. I'll try to zip up the file and post it as soon as I can.
Thanks
Oh, if you've replaced the sprite file with one from the demo game I wouldn't expect that to work.
Is it possible you tried to save the game in the editor while it was running? This is a known problem that can break the sprite file, and in the next version the Save option will be disabled while you're running the game.
CJ - Instead of disabling it would it be better to have it auto-close the game and then save? Sometimes people click save because they're worried something bad is going to happen (power outage, crash) so this would satisfy emergencies and protect the sprite file. Just a thought.
Well, I think that would make people complain that it had closed the game they were in the middle of debugging .. besides, in order to run the game it will have had to save it at that point, and you're unlikely to be making extensive changes in one debugging session.
Fair enough.
I am fairly sure I saved the game before running it. However, I built the same game a second time because of the crash...and it happened again and that time I definately didn't save whilst the game was running. Weirdly though it let me add more than it did last time before crashing?
Could it be due to file size? Or the resolution the pictures are in?
Is the game folder on your hard drive or are you trying to run it off a USB stick or something? I seem to remember somebody having strange problems when they were trying to develop the game on a USB drive...
No, none of my stuff is on remote or extended storage it is all soted on the internal hard drive. It is just really strange how it has happened twice now?
Hmm yes, you shoudln't get this error once, let alone twice... I presume you're running the latest version of AGS?
When this error happens, is there still a file called ACSPRSET.SPR in the game folder?
I am indeed using the latest version, downloaded the new one no more than a few weeks ago?
Yes that file is present when the error happens, there is no "backup" file of the same name when the error occurs.
Thanks
I looked through the Error Reports log and found this, which was sent at about the time of your original post:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at save_sprites(Boolean )
at AGS.Native.NativeMethods.SaveGame(Game game)
at AGS.Editor.NativeProxy.SaveGame(Game game)
at AGS.Editor.AGSEditor.SaveGameFilesProcess(Object parameter)
at AGS.Editor.BusyDialog.RunHandlerOnThread()
Do you remember if this is the first error message that you got? If so, that indicates that it crashed while trying to save the sprite file (and therefore leaving a corrupt sprite file which couldn't be opened in future, leading to the Unable To Find Sprite 0 error).
The puzzling thing is why it crashed saving the file ... would it be possible to upload the image file that you had just imported at the time? If you import it again now, does it cause the crash again or does it work fine?
That could well be the error message, I didn't read it too closely but it sounds about right for the error that I had.
I have to be honest I couldn't tell you which sprite it was.....I imported several all at the same time. A number for a walk view, several as objects and invent items?
I guess the only thing I could do is import everything one by one and press save each time to see if it catches a certain file when crashing?
Although I think the second time it crashed, I had imported more than the first time?
Thanks
Strange, has anyone else had any problems like this?
Re loaded all the graphics and had no problems, realised that the sprites were too big for my walk view deleted them and hit save and this came up:
Error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Version: AGS 3.1.2.82
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at save_sprites(Boolean )
at AGS.Native.NativeMethods.SaveGame(Game game)
at AGS.Editor.NativeProxy.SaveGame(Game game)
at AGS.Editor.AGSEditor.SaveGameFilesProcess(Object parameter)
at AGS.Editor.BusyDialog.RunHandlerOnThread()
--- End of inner exception stack trace ---
at AGS.Editor.BusyDialog.Show(String message, ProcessingHandler handler, Object parameter)
at AGS.Editor.AGSEditor.SaveGameFiles()
at AGS.Editor.Components.FileCommandsComponent.CommandClick(String controlID)
at AGS.Editor.ToolBarManager.ToolbarEventHandler(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
And now I am receiving the same getspriteasbitmap error I had 2 times before? I submitted this as well when it asked me to? Really is odd how I can't seem to get pass this?
Hmm, have you been re-ordering sprites by dragging them around?
There's a known bug in 3.1.2 SP1 where if you drag a sprite to the end of the list it doesn't move it but instead duplicates it, and you end up with that sprite then in the list twice; as a result the sprite file can get corrupted.
This bug will be fixed in the next version of AGS, but if you have been dragging sprites around then please can you try not doing so, and see if that gets rid of the problem?
Nope haven't been dragging sprites around at all, I replaced a few...based on that I had sized them too large edited them and replaced them with a smaller version? However I have not been dragging or moving any of the files around?
Thanks
Are there any duplicate sprites in your Sprite Manager window? (ie. you see more than one sprite with the same number?)
The first time this happened I am sure there were not duplicate sprites, as I replaced old sprites rather than adding new. I can not be so sure the second time as I went in and started adding new sprites so they may have doubled?
Thanks
Hmm, well as you're having this problem such a lot, would you mind making a backup copy of your game, then trying out the AGS 3.2 Beta 4 release? It has a few fixes and it would be interesting to see whether you still get the problem with the new beta.
Yeah, I'll go get the download now see what happens?
Thanks
Sorry to dig up an aging thread, but I encountered a similar problem, using the new beta 3.2.0.93.
I'd been seeing the (bizarre?) "read or write of protected memory" crash described here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=37668.msg507261#msg507261) once every three or four work sessions with the new beta.
AGS crashed this way during the pre-"Run without debugger" autosave. After restarting, all sprites were black single-color squares, and the sprite cache was drastically smaller in file size! Like trees at the blast site, all the imagery was vaporized - leaving only blackened skeletons!
GOOD THING I BACKED UP.
Sorry I can't be more precise about this, but it happened so fast. I'm using XP 5.1 SP2 if that helps. This crash definitely occurred in the middle of the autosave, though.
@Hofmeier:
why not downgrading to AGS 3.2 Beta 3, that release is pretty stable. At least, that's what I did ;)
Quote from: hofmeier on Fri 04/09/2009 15:57:54
Sorry to dig up an aging thread, but I encountered a similar problem, using the new beta 3.2.0.93.
I'd been seeing the (bizarre?) "read or write of protected memory" crash described here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=37668.msg507261#msg507261) once every three or four work sessions with the new beta.
Please post problems with the beta in the Beta thread. Also, if you're getting an editor crash PLEASE use the Send Error Report button so that I get notified about it with details that will help me fix it.