getSpriteAsBitmap32bit: Unable to find sprite 0

Started by Toxicmaboroshi, Sat 18/07/2009 17:33:31

Previous topic - Next topic

Toxicmaboroshi

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?

Pumaman

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?

Toxicmaboroshi

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

Pumaman

Are there any duplicate sprites in your Sprite Manager window? (ie. you see more than one sprite with the same number?)

Toxicmaboroshi

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

Pumaman

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.

Toxicmaboroshi

Yeah, I'll go get the download now see what happens?

Thanks

(deleted)

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 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.

abstauber

@Hofmeier:

why not downgrading to AGS 3.2 Beta 3, that release is pretty stable. At least, that's what I did ;)

Pumaman

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 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.

SMF spam blocked by CleanTalk