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
501
Reaction score
478
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 Posts

Latest Profile Posts

Camping inside a hidden cave.
LzSHByh.jpg
I don’t believe in astrology. I’m a Sagittarius and we’re skeptical.
senary_concept_art.png
The concept art for the sprite of Senary, a major character in my upcoming (as-of-yet-unnamed) project. She is known as the Timelord because she can "stop time" by making eye contact with a person; Paralyzing them for a short period of time through a type of hypnosis. Tell me what you think about her. I'm thinking of changing the color of her coat.

Forum statistics

Threads
124,368
Messages
1,163,125
Members
163,166
Latest member
lawerencewils
Top