Pictures that don't load when they have to

I'm having a serious problem in my plugin with pictures that aren't loading correctly, pincipally on web brow2ser version, but the problem occurs on the rmmv test plataform too. They load, but I need to change the index selection one or two times until they appear. (leaving the selector over the index make them do not update, so they never appear.

Images:

The problem:

problem.png


How this was supposed to be:

SaveEngineVarwithNames.png


The actual script:

Downloads:

CORE: https://dl.dropboxusercontent.com/u/110216365/PLUGINS/HELP/ArkDG_SaveScreen.js
Confirmation Plugin: https://dl.dropboxusercontent.com/u/110216365/PLUGINS/HELP/Ark_SaveEngine_Confirmation.js
Variables WIndow Plugin: https://dl.dropboxusercontent.com/u/110216365/PLUGINS/HELP/Ark_SaveEngine_VariablesWindow.js
 

My test game link so you can have a look on the problem by yourselves: https://dl.dropboxusercontent.com/u/110216365/PorjetoExp/index.html


I tried a loadlistener that doranifoku teached me, but it didn't work. I don't know if I'm doing something wrong... 

How would you fix this problem? Where did I failed?

PS.: I know, I'm turning myself into a recordist of this forum hah 
it works fine for me

Edit: no it's not. btw, can you give the js link? i try copy and paste your code but it's not the same version.
It's the same version. Maybe the difference is because you don't have the addon plugins.

Downloads:

CORE: https://dl.dropboxusercontent.com/u/110216365/PLUGINS/HELP/ArkDG_SaveScreen.js
Confirmation Plugin: https://dl.dropboxusercontent.com/u/110216365/PLUGINS/HELP/Ark_SaveEngine_Confirmation.js
Variables WIndow Plugin: https://dl.dropboxusercontent.com/u/110216365/PLUGINS/HELP/Ark_SaveEngine_VariablesWindow.js
 

Do you have any idea of what to do? 
Window_SavefileStatus.prototype.drawScreenshot = function(id, x, y) { //var dataUrl = this.saveReader(brokenID).thumbnail; if (ark_showThumbnail == 0 && this.saveReader(brokenID).thumbnail != undefined && this.saveReader(brokenID).thumbnail != null) { console.log('Map_Data_Here:' + this.saveReader(brokenID).thumbnail); var bitmap = new Bitmap(ark_thumbnail_w, ark_thumbnail_h); bitmap._image = new Image(); bitmap._image.src = this.saveReader(brokenID).thumbnail; // The "ark_urlData" content in the save file header. bitmap.addLoadListener(function() { bitmap._onLoad(); this.contents.blt(bitmap, 0, 0, bitmap._canvas.width, bitmap._canvas.height, Graphics.boxWidth + ark_thumbnail_x, ark_thumbnail_y, ark_thumbnail_w, ark_thumbnail_h); }.bind(this)); } else {console.log('FAILED LOADING MAP')} };What I know:

The image is loaded in time, it was suposed to appear on the screen. But it don't appears and I don't know for what reason.

The loadListeners aren't making any diference.

Sometimes this don't happen, looks like it deppends upon an "incontrolable" force... The machine? 😛

This only happens for these two set of images. if I change the SV_actors for the default charsets, they are instantly laoded with no problems.

My conclusion is: I need the same method that the charsets use for these two images. But the problem is: Whenever I try to reproduce the functions for this new purpose, I don't get the same results. the images still don't appear in time.

Please, help me. ):
Images are loaded asynchronously. Depending on a multitude of factors, your image may not appear when the code runs.


The approach you're using is correct: add a load listener, and draw it when the image is ready.


If you need the images to be drawn instantaneously then you need to wait until the images are ready before you draw the screen, or pre-load the images beforehand.
Hm... unsderstood.

I don't know how to Preload images. Yet, when I think about the term "preload", I imagine that this wouldn't be the best choice for a "on the run" dinamic information board, where its contents changes everytime. I might be wrong about that, anyway.

So I thought, then, that to make the Status window wait the images to be loaded before the screen updates to redraw it, seems to be the right way.
 

Anyway... Can you teach me how to do it? i.i
Hm... unsderstood.


I don't know how to Preload images. Yet, when I think about the term "preload", I imagine that this wouldn't be the best choice for a "on the run" dinamic information board, where its contents changes everytime. I might be wrong about that, anyway.


So I thought, then, that to make the Status window wait the images to be loaded before the screen updates to redraw it, seems to be the right way.


Anyway... Can you teach me how to do it? i.i
Preload just means it's being loaded before you actually display your stuff. So in the method that checks whether the scene is ready, you would include some logic to determine WHAT you want the players to see, and load them. If you truly need this to be dynamic as in, it changes in front of them, you may need to accept that it won't appear immediately.


Think of websites: sometimes the page is displayed, while the images are still being loaded. You can always draw them after they've loaded, but there may some delays depending on things like how fast their internet connection is (if the image needs to be DL'd), or how fast their device is.
hm... Well, no problem. It's not that dinamic anyway. It's just a picture saved inside a .rpgsave file, and png files that are loaded to make the SV Actors  that I load when the selector is over its index on the files list.

So, I expressed me wrong.

The images pre-exists inside the .RPGsave files and inside the sv actors folder.

Preload or "wait method to draw screen", I just need the images to appear. 🙁

And I don't know how to do it. I really would need you to teach me the function of the process . 

Please, help me tsukihime if you know what to do. i.i

(I plan to make others plugins that would focus in menus, images and stuff. So learning it would be of great help.)
Unfortunately I only know the theory behind how it works, and not the actual implementation lol


I'm also having difficulties with my own image-related plugins.
Hehe yes, I saw a topic where you related a problem like that. Was there too that I learned about the loadListener.

I though you had solved the it. But, well, now we (or I) know what we want. The only thing missing is someone that knows how to solve the problem.

I'm still trying to find a solution. The ones that I thought might be a little too laborious and awkward, but if I have success, I will share here.

I just wished that I could release the final update for my plugin today, with no more problems. Anyway, tks and good luck too.
Well, I learned the way to make what I wanted.

I preloaded the images.

I searched and found help out of here. @Tuskihime, if you or anyone wants to know how to do, it is easy but extensive...

I'm not in the mood of posting it here. Send me a PM and I'll help.

Original thread: https://forums.rpgmakerweb.com/threads/pictures-that-dont-load-when-they-have-to.52509/