Character "flashes" before first activation of common event changing sprite (Yanfly Button Common Events)

QuietPenguin

Veteran
Veteran
Joined
May 24, 2020
Messages
30
Reaction score
12
First Language
English
Primarily Uses
RMMV
Quick question about something I've been playing around with:

Using Yanfly's "Button Common Events," I made a little button-activated animation to allow the player to draw, sheathe, and fire a gun. Currently those commands are mapped to the "E," "R," and "T," keys, respectively. The common events triggered by those keys change the actor image when activated between three different sprites. The "fire" command includes a conditional branch that activates it only if the gun is already drawn. I have recorded a short video, embedded below.

Video:


Plugin: http://www.yanfly.moe/wiki/Button_Common_Events_(YEP)

Here's my question: You actually can't really see this in the video clip because it happens too quickly, but I've noticed that the first time I "draw" and "fire" the gun, the player character quickly "flashes" (disappears and reappears) in a single frame. During gameplay it's definitely noticeable. The interesting thing is that subsequent uses of those commands do not cause the same issue. So my question is, any idea what causes that? And is it something that is fixable? Or just some sort of lag inherent in the engine / plugin when the common event is activated? Thanks!
 

SeaPhoenix

Veteran
Veteran
Joined
May 14, 2015
Messages
212
Reaction score
180
First Language
English
Primarily Uses
RMMV
I had something similar happen to me when I used a common event to change the player character's image to a sprite that was on a different spritesheet. So if your sprites are currently on different spritesheets, you can try putting them all on the same spritesheet to see if this gets rid of the "flashing".

However, if your sprites are already all on the same spritesheet, then maybe you'll have to show us the commands in the common events (though it sounds like they're just the Change Actor Images commands).
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
435
Reaction score
1,384
First Language
Bahasa
Primarily Uses
RMMV
Yea, it's due to lag. The graphic is being loaded and cached in that same instant frame. That's why it only happen the first time.
Either you preload the graphic manually each time you enter map beforehand, or use a preload plugin.
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
528
Reaction score
222
First Language
thai
Primarily Uses
RMMV
if I guess the img didn't load fast enough
just preload it by trigger the stance one time before fade in screen
so the stance already stock in memory to use later
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
522
Reaction score
404
First Language
English
Primarily Uses
RMMV
the script command to precache event images is

Code:
ImageManager.reserveBitmap('img/characters/',fileName);
 

QuietPenguin

Veteran
Veteran
Joined
May 24, 2020
Messages
30
Reaction score
12
First Language
English
Primarily Uses
RMMV
Thanks guys! This was the issue.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Yo Ho Ho... Time flies when you are having rum...

I'm rewatching Glee, just watched grilled cheesus.
Now I'm not sure if I'm hungry or I want to cry.
I just completed Ara Fell - completing the game unlocks an Epilogue. An interesting thing to possibly consider for my games.
I decided to try to make a mucha-styled artwork, and by now I've sunk more time in studies and sketches than I usually do in the whole thing. Fingers crossed it's worth it!

Forum statistics

Threads
99,451
Messages
965,434
Members
131,067
Latest member
LeoWolf
Top