Bundle certain files with the project/Placing game sprites in the game's save folder?

Fluury

Member
Heya.

I'd like to place a few sprites from the game in a strip-format within it's save folder. Originally I thought I could do this by simply doing sprite_save_strip() when I initially create the save file for the game - referencing a sprite within the game etc. .But interestingly enough that does not appear to do anything. All examples have it use a surface, so maybe that's required?

Is this the only way I could save sprites on the user's PC?
 

obscene

Member
You should be able to do it as you described. Are you sure you are monitoring the correct folder where it's being saved? appdata/local/etc?
 

TheouAegis

Member
Is this an internal sprite asset defined in the IDE or one you added via code(e.g., sprite_add() calls)? If it was added via code, your folders are probably wrong. If it's an internal asset, test if putting sprite_duplicate() around the sprite_index works; if it does, then sprite_save_strip() would only work with code-created sprites. I don't remember that being the case, though.
 

Fluury

Member
You should be able to do it as you described. Are you sure you are monitoring the correct folder where it's being saved? appdata/local/etc?
Is this an internal sprite asset defined in the IDE or one you added via code(e.g., sprite_add() calls)? If it was added via code, your folders are probably wrong. If it's an internal asset, test if putting sprite_duplicate() around the sprite_index works; if it does, then sprite_save_strip() would only work with code-created sprites. I don't remember that being the case, though.
I should've updated the thread after finding a resolution.

You are indeed correct: It appears the function only works via. sprites added through code. The below works:

GML:
var _base_copy = sprite_duplicate(sCustomCar);
sprite_save_strip(_base_copy,CUSTOMCHARDIRNAME + "base_reference.png");
sprite_delete(_base_copy);
Directly referencing "sCustomCar" however does not yield any result. It is worth mentioning that I am on 2.2.5 since 2.3 introduces some rather destructive bugs for the project I am using. If this issue is still a thing in 2.3. someone else would need to test.
 
Top