When or where do we use preloading functions?

Hey there and thank you for helping me understand something. 😅

Let's say we made a game with events like books, notes, a phone tablet and whatever you can imagine needs a screen to pop up, draw nice images on top, write out some text if necessary and will be closed by any other function later on. So the notes, books, computers, screens are just triggered on the map. Simple and plain "links" to a common event.
In this common event, that is only triggered - if - we would use the event-link on the map, are all pictures stored.

So my question would be:
What possibilities that make sense exist to preload these fancy drawn image popups?

Is it even possible to really preload these specific used pictures in a common event, that is only triggered - if - the player uses the event-link on the map by clicking on it?
Should we maybe include a common event preload function on the map, so these necessary pictures that have to be drawn eventually will be loaded for sure?

The reason for this question is, I ask myself if a link like trigger, that triggers the book, note or whatever else, would be able to trigger the preload of a common event, if it is not used?! (so in my understanding inactive - so no preload when we step onto the map)

Should it not be preloaded at this particular point, since the event link to the really heavy book, phone, tablet or whatever else becomes available right there? Or is it really enough to preload everything at the top of these common events that would be used?

Thank you for helping me understand.
any preload should be done as late as possible while still having enough time to complete the load function.
any later call means there is a remaining load delay, and any sooner wastes RAM.

Problem is the computer can't always load anytime, you can only look for possible triggers.

In your case, it depends on how much you have to load. The best option for limited preloads would be when the map event is started, not when the common event is called. But keep in mind that every file preloaded needs time to be loaded, especially if there are many files.

if the journals have many pictures it might be an idea to do this on map load to allow more time for loading, but that would only work if the total files can be kept in RAM - too many preloads and that will no longer work and use too much RAM.
you preload *at the top-most parent point shared between all children scenes* that will use those resources.
which implies flow, which implies writing.

and if you can, you write *in a way that will send whatever final resource used outside of whatever narrative, over to an even higher level*, to be loaded from a savegame at main menu level.
that way you go from 0 to 9 through the game, and when it comes to 10, *10* is part of the main menu, is the thing that sums up 0-9, is the only thing that remains, and 0-9 are discarded and never loaded again.

Original thread: https://forums.rpgmakerweb.com/threads/when-or-where-do-we-use-preloading-functions.173343/