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
330
Reaction score
273
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

RushLog wrote on HarlekinLehl's profile.
how do you attach those images to your posts?
I picked up FF III pixel remaster for the mobile discount sale. I guess that's on my plate after I finish Lunar Silver Star Story. That said, I am strongly considering an entry for the IGMC 2022 since an idea came to me for this year's theme.
Map033.png Road to the ruins of the temple of light you'll be exploring after leaving Teytal. Can I get some Yays?
I just bought VN Maker with 75% off, just for the assets.
IGMC is back everyone!

Forum statistics

Threads
123,207
Messages
1,154,916
Members
161,589
Latest member
Crizzaro
Top