[SCRIPTING] [RMMV] ACTOR FACE NOT DISPLAYING PROPERLY ON SCENE_MENU

Posts

Pages: 1
Hi there.

I have this issue where the actor's face image won't load the first time Scene_Menu is called, and I'm honestly not sure why? I repurposed Window_Status by making it pop up on Scene_Menu instead. Like so:

First call:

After closing the menu, then re-opening it:


It seems that if I go to any other scene (say, to skill, item, or equip) after accessing the menu, then go back to menu, it would also load properly.

Here's the create function in Scene_Menu, which I pretty much copy-pasted from the MenuStatus one.
Scene_Menu.prototype.createAltStatWindow = function() {
this._altStatWindow = new Window_Status();
this._altStatWindow.reserveFaceImages();
this._altStatWindow.x = this._commandWindow.width
this.addWindow(this._altStatWindow);
};

There's also this, which I copied from Window_MenuStatus (although idk where this function is called, since Scene_Menu doesn't seem to have a call for it).
Window_Status.prototype.loadImages = function() {
ImageManager.reserveFace($gameParty.members()[0].faceName());
};

Thanks in advance for the help!

Edit: I forgot to add a topic title.
Think you're running into an async loading issue.
And visiting any of the other scenes means the face set is already in the image cache.

You can call bitmap.isReady() in your update function and redraw when the images have loaded.

e.g. look at what Window_Message.prototype.updateLoading does
author=coelocanth
Think you're running into an async loading issue.
And visiting any of the other scenes means the face set is already in the image cache.

You can call bitmap.isReady() in your update function and redraw when the images have loaded.

e.g. look at what Window_Message.prototype.updateLoading does

It works properly now! Thanks a bunch! I had to add a janky extra catch there because it was continuously refreshing every tick, but otherwise, the tip about updateLoading was what fixed it.

Here's what it ended up being, for others' reference:
Window_Status.prototype.update = function() {

Window_Base.prototype.update.call(this);
if (this._actor){
if (ImageManager.isReady() && !this._loaded){
this.refresh();
ImageManager.releaseReservation(this._imageReservationId);
this._loaded = true;
console.log('aaaaa');
};
};
};
Pages: 1