• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker 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