Pictures that don't load when they have to

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
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:



How this was supposed to be:



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 
 
Last edited by a moderator:

izyees

My Secret Santa
Veteran
Joined
Oct 24, 2015
Messages
248
Reaction score
67
First Language
english
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.
 
Last edited by a moderator:

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
Last edited by a moderator:

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
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? :p

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. ):
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,848
First Language
English
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.
 

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
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
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,848
First Language
English
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.
 

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
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.)
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,848
First Language
English
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.
 

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
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.
 
Last edited by a moderator:

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top