Small 'blink' when using "Change Image..." command.

Faye Valentine

The Mapgician
Veteran
Joined
May 2, 2014
Messages
471
Reaction score
427
First Language
Spanish
Primarily Uses
RMVXA
As the title says, when you use the "Change Image..." command through a "Set Move Route" command, the event will blink shortly before changing it's graphic to the one you assigned. I've tested this in both my project and a blank one. I myself investigated this and realized that the reason is simple: the RPG Maker doesn't have the image you're trying to change cached, so when you activate the command the RM first loads the image then shows it. I don't know if this is noticeable at 60fps, I doubt it, but at 30-40fps it is quite noticeable, and those fps are not "low" at all.


I came up with a quick solution (back in the day man, you had to search for amends without using scripts) which is manually caching the graphics I'll use on that map by putting an event on parallel process, set to transparent and change to every image I'll use, then erase the event as shown here:








When you do that, there won't be any blink anymore because the graphics are already loaded. 


Now, I do have a solution, but it's not a practical one. I don't have problems rolling with it tho, honestly, but it'd be cool if any other person out there (or a newbie) that's having the same problem, could get a better, automated solution AKA Plug-in.


I tried Galenmereth's TDD_PreloadManager but for some reason it doesn't resolve the problem. Maybe I'm using it wrong? I did use the custom pre-load command within the .js file, if anyone asks.
 
Last edited by a moderator:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
Hmm ... just to test to see if the images are being properly cached, give this a try :


ImageManager.loadCharacter('name-of-character-file');
this.setWaitMode('image');


Place that in an autorun event at the beginning of the game, or directly before the sprite swap in the event. The first line will load and cache the character file, and the second line is informing the interpreter of the event to stop and wait until all images have been loaded before continuing. The scriptlet should allow for a seemless transition.
 
Last edited by a moderator:

Faye Valentine

The Mapgician
Veteran
Joined
May 2, 2014
Messages
471
Reaction score
427
First Language
Spanish
Primarily Uses
RMVXA
Hey Ossra (or Exhydra :p) The code did work. Thank you for that, really helpful. Is it possible to load multiple images by adding commas?, like:


ImageManager.loadCharacter('Image1', 'Image2', 'Image3');
this.setWaitMode('image');




Oh, by the way, with the " : " the code shows an "Unexpected token :" error. I realized this instantly but just in case someone copy-pasted the entire code without knowing lol.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
Hey Ossra (or Exhydra :p) The code did work. Thank you for that, really helpful. Is it possible to load multiple images by adding commas?


Oh, by the way, with the " : " the code shows an "Unexpected token :" error. I realized this instantly but just in case someone copy-pasted the entire code without knowing lol.


Ah, I copied the text from the test event I created as there was originally a Move Route which performed the sprite swap, but I removed that afterward and forgot to remove the rest. I haven't had my coffee this morning.


To load multiple images you will have to add another line :


ImageManager.loadCharacter('Image1');
ImageManager.loadCharacter('Image2');
ImageManager.loadCharacter('Image3');
this.setWaitMode('image');


Keep in mind that you will need to change the method from 'loadCharacter' to 'loadPicture', or 'loadFace', or so on if you want to cache other graphic files. I am working on a preload plugin, but it is currently in the alpha stages. I believe Galenmereth was planning on updating the preload plugin at some point, anyway.


EDIT: Or I suppose you could create an array of graphic names and use the following to load everything up :

Code:
var tImg = ['!Chest', '!Other1', '!Other2'];
for (index in tImg) {
  ImageManager.loadCharacter(tImg[index]);
}
this.setWaitMode('image');
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top