• 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!

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

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