MV Preloading assets while map transferring or manual trigger?

Hello!
I searched and can only find a preloader that loads ALL the assets before the game starts.
Now that sounds amazing, but I wonder if I can just have it everytime I map transfer/scene change/manual trigger?
I don't mind if it makes the game have a loading time everytime you map transfer as long as all the assets in the next map is already preloaded.

My goal is to have it so it won't have to preload everything at the start even though the asset is not needed for the next map.
Galv_ImageCache can load what you want with scriptcall and erase event,
but doesn't clear it, you need to modify it or use a scriptcall to unload it from
cache, but that depends on the needs.
Galv_ImageCache can load what you want with scriptcall and erase event,
but doesn't clear it, you need to modify it or use a scriptcall to unload it from
cache, but that depends on the needs.
Yes I've tried that plugin but because it doesn't clear them after you transfer on another map, it'll accumulate in the end just like SRD Preloader which loads everything at the start.

What's the scriptcall for unloading assets from the cache?
JavaScript:
ImageManager.clear(); // to clear the entire cache

var path = "your path here";
var key = ImageManager._generateCacheKey(path, hue);
delete ImageManager._imageCache._items[key]; // specific image
you can do it automatically on transfer, but I think someone needs
to help you with it or implement it in galv_ImageCache.
you can do it manually on transfer (or in a common event) and on a
transfer event, but that would be rather tedious.

but it does the job for you 🙂
JavaScript:
ImageManager.clear(); // to clear the entire cache

var path = "your path here";
var key = ImageManager._generateCacheKey(path, hue);
delete ImageManager._imageCache._items[key]; // specific image
you can do it automatically on transfer, but I think someone needs
to help you with it or implement it in galv_ImageCache.
you can do it manually on transfer (or in a common event) and on a
transfer event, but that would be rather tedious.

but it does the job for you 🙂
Thank you. I will try this out!
I do have a question if that's ok, what's "your path here"?
I don't quite understand what I need to put in there.
the path is to the location of the image and set it to string, like:

var path = "img/characters/Actor1";

now I dont know if you need to add the extension to it, but its something
you need to test, I think there was one recently that asked this, but the
scriptcall was incorrect because it was missing something.

while this is correct, I dont have the time now to look for it, but test it
and see if it works.

characters can also be pictures and any valid folder you have there.
the path is to the location of the image and set it to string, like:

var path = "img/characters/Actor1";

now I dont know if you need to add the extension to it, but its something
you need to test, I think there was one recently that asked this, but the
scriptcall was incorrect because it was missing something.

while this is correct, I dont have the time now to look for it, but test it
and see if it works.

characters can also be pictures and any valid folder you have there.

Thank you very much for the help. I would test it thoroughly after my work!
here is the other forum thread that wanted specific images to be removed:
just in case, some has it preloaded into an array to remove it from there.

Good luck with your project ^^
preloader that loads ALL the assets before the game starts.
That will never work correctly by the way, because no computer has unlimited RAM.

All assets need to be stored in RAM to be used, and if the RAM gets full the automatic garbage collector will remove the assets that were unused the longest.

So loading everything at the start of the game will result in most of that being removed before you make your first step as a player.

Preloaders only work correctly if you can give the preload order more or less about ten second before the file is used. And GOOD preloaders allow you to specify which files to remove, so that it isn't the more or less random garbage collect that might remove a file that is used several times just because it wasn't use for some interval.
That will never work correctly by the way, because no computer has unlimited RAM.

All assets need to be stored in RAM to be used, and if the RAM gets full the automatic garbage collector will remove the assets that were unused the longest.

So loading everything at the start of the game will result in most of that being removed before you make your first step as a player.

Preloaders only work correctly if you can give the preload order more or less about ten second before the file is used. And GOOD preloaders allow you to specify which files to remove, so that it isn't the more or less random garbage collect that might remove a file that is used several times just because it wasn't use for some interval.
I guess I had barely any assets that needs to be Preloaded by the SRDPreloader plugin?

At any case, that is why I wanted this every map transfer clearing the assets that aren’t going to be used in the map you’re transferring to, and then loading the assets that are actually going to be used, before the fade to the next map starts.

I don’t mind having loading screens every map transfer if it means a smoother asset usage.

Original thread: https://forums.rpgmakerweb.com/threads/preloading-assets-while-map-transferring-or-manual-trigger.162735/