• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

GMS 2 sprite_save() failed - no bitmap data available

I'm getting this error when trying to use sprite_save(spr_background, 0, "saves/bg/image.png").

I've ruled out the immediately obvious: the sprite index points to a valid sprite, and the image index points to a valid image within that sprite with pixels in it. Anyone have any other ideas as to why GM might be thinking there's no bitmap data available?
 

TheouAegis

Member
Try removing the second argument. I know the help file says there are three arguments, but the help file also has an example using only the first and last arguments. lol

Edit: nevermind, apparently they fixed that typo in the second manual. Lol

Since this is studio 2, I have an urge to ask this: what code did you use to create spr_background? And how did you verify that it is a proper existing Sprite?or is it a Sprite resource that you already included in the project to begin with, which kind of begs the question why you would need to save it. lol
 
Last edited:
Try removing the second argument. I know the help file says there are three arguments, but the help file also has an example using only the first and last arguments. lol

Edit: nevermind, apparently they fixed that typo in the second manual. Lol

Since this is studio 2, I have an urge to ask this: what code did you use to create spr_background? And how did you verify that it is a proper existing Sprite?or is it a Sprite resource that you already included in the project to begin with, which kind of begs the question why you would need to save it. lol
It's a Sprite resource, because I haven't gotten to implementing programmatically generated sprites yet, lol. Once I get sprite_save to work for a built-in resource, then I'll try it with a generated one.
 
Are you using this sprite as part of a tileset?

If you are, you might have to uncheck "DIsable Source Sprite Export" in the Tileset settings.
 
Top