RMMV [Solved]Display a specific face ID during YEP_VictoryAftermath

Kaymon145

Veteran
Veteran
Joined
Apr 22, 2022
Messages
34
Reaction score
17
First Language
English
Primarily Uses
RMMV
Hello everyone, I am using Yanfly's VictoryAftermath plugin which displays the actors face portrait during victory as well as experience gained ect. All my actors have their own face sheet with different emotions and I'm wanting to display a certain one on the victory screen. Things I have tried are:
-Calling a common event in the troops tab when each enemy HP <= 0,
I'm running HIME_EndPhaseTriggers that checks for any troop events before end of battle.
Code:
If : Script: $gameTroop.isAllDead()
Script : $gameActors.actor(1).setFaceImage("Actor1", 4)
Script : $gameActors.actor(2).setFaceImage("Actor1", 4)
Script : $gamePlayer.refresh() ///Tried with or without this line and dosen't seem to make a difference
End
This strangely worked for a while but wasn't very reliable as it didnt seem to trigger all the time, my guess is its checking if all enemies are dead before the last one fully dissapears but im not sure.

-Tried running the same common event with SRD_BattleEndEvents, but unfortunately this triggers after the victory screen reguardless of where it is on the plugin list.

I'm looking at this line in YEP_VictoryAftermath at this line and wondering if theres a way to change it display a specific face ID, all my actors faces are set up the same so if could just display say, image 4 for everyone and it would work out.
Code:
BattleManager.prepareVictoryInfo = function() {
    $gameParty.allMembers().forEach(function(actor) {
        ImageManager.loadFace(actor.faceName());
        actor._preVictoryExp = actor.currentExp();
        actor._preVictoryLv = actor._level;
        actor._victoryPhase = true;
        actor._victorySkills = [];
    }, this);
Or, if anyone has any other ideas let me know! I tend to overthink these kinds of things so I could be missing a much simpler solution!
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
515
Reaction score
495
First Language
English
Primarily Uses
RMMZ
If the filename for the faces is the same, and all you want to change is the index, then there is no need to change the particular snippet you posted. The function you want to look for is this one:

JavaScript:
Window_VictoryExp.prototype.drawActorProfile = function(actor, index) {
    var rect = this.itemRect(index);
    var fw = Window_Base._faceWidth;
    this.drawActorFace(actor, rect.x + 1, rect.y + 1, fw, rect.height - 2);
};

Try changing it to:

JavaScript:
Window_VictoryExp.prototype.drawActorProfile = function(actor, index) {
    var rect = this.itemRect(index);
    var fw = Window_Base._faceWidth;
    var oldFaceIndex = actor.faceIndex();
    actor._faceIndex = 4;
    this.drawActorFace(actor, rect.x + 1, rect.y + 1, fw, rect.height - 2);
    actor._faceIndex = oldFaceIndex;
};

In my head, it seems like that should work, but I haven't actually tested it, so let me know if it doesn't.
 
Last edited:

Kaymon145

Veteran
Veteran
Joined
Apr 22, 2022
Messages
34
Reaction score
17
First Language
English
Primarily Uses
RMMV
If the filename for the faces is the same, and all you want to change is the index, then there is no need to change the particular snippet you posted. The function you want to look for is this one:

JavaScript:
Window_VictoryExp.prototype.drawActorProfile = function(actor, index) {
    var rect = this.itemRect(index);
    var fw = Window_Base._faceWidth;
    this.drawActorFace(actor, rect.x + 1, rect.y + 1, fw, rect.height - 2);
};

Try changing it to:

JavaScript:
Window_VictoryExp.prototype.drawActorProfile = function(actor, index) {
    var rect = this.itemRect(index);
    var fw = Window_Base._faceWidth;
    var oldFaceIndex = actor.faceIndex();
    actor._faceIndex = 4;
    this.drawActorFace(actor, rect.x + 1, rect.y + 1, fw, rect.height - 2);
    actor._faceIndex = oldFaceIndex;
};

In my head, it seems like that should work, but I haven't actually tested it, so let me know if it doesn't.
Works like a charm, thank you!!
 

Latest Threads

Latest Profile Posts

My game has a (much needed) tutorial now...
Game Making Every Day #20:kaohi:

ScreenShot_8_14_2022_11_55_51.png
FINALLY added the comic bubble to the Title Screen...
I know I'll put one of my game's sprites here to give the illusion that I am a productive member of game society.
handelspriteanim.gif

Forum statistics

Threads
124,507
Messages
1,164,110
Members
163,333
Latest member
TheWarDon
Top