• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

GMS 2.3+ sprite_prefetch_multi not working? array param invalid

kupo15

Member
I don't understand why sprite_prefetch_multi is not working. In this code, I'm getting the asset index of main_menu_0 and 1. If you look at the debugger, the array loaded_texpages contains the id's of both sprites yet the prefetch code fails to load them. The same thing happens with sprite_flush_multi, it fails

The only way I can load this is by using texture_prefetch which I believe will require a bit of hardcoding the texturepage names instead of being dynamic like this. If I can use texture_prefetch dynamically like sprite_prefetch lmk, I'd rather do that

1601683345485.png
 
Last edited:

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
Does it work if you create an array with the sprites themselves? Eg:

GML:
var _a;
_a[0] = main_menu_0;
_a[1] = main_menu_1;
sprite_prefestch_multi(_a);
 

kupo15

Member
Does it work if you create an array with the sprites themselves? Eg:

GML:
var _a;
_a[0] = main_menu_0;
_a[1] = main_menu_1;
sprite_prefestch_multi(_a);
nope it does not work when even after manually setting the sprites in the array
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
In that case I'd file a bug report.... Sorry I can't be more helpful.
 

kupo15

Member
In that case I'd file a bug report.... Sorry I can't be more helpful.
Just did! There isn't any way to get the name of a texture group dynamically is there? I know you can get the id of a texture page via the sprite but I don't see a way for like texturegroup_get_name(sprite_index) sort of thing
 
Top