"%1 was defeated" being overwritten?

I noticed that when I got a Game Over the message simply read "was defeated" instead of "Simon's party was defeated."
On the Terms tab of the data base, it clearly shows the correct code
1657889220784.png


I turned off every single plugin in case one of them was overwriting this, but it still happens.

Can anyone suggest what I should do next?
I think there is a different message for when you lose a battle with

- A single member (%1 was defeated)
- A party with atleast 2 members (%1's party was defeated)

Did you do something to the "Party Name" message?
@ScorchedGround I've done nothing to the 'Party Name' message (don't even know where it is), but in this instance it was a party of 3, so that shouldn't be an issue.
If my memory serves right (that was in VXAce), what ScorchedGround said was right, and it was also likely carried to MV/MZ as well. @Kes you can start by trying to lose/win with one party member, then multiple party members. Then, change the leader of the party (the one in the first index).

Yes, this is the default behavior of the default code base.

Edit: It looks like I misread the original question. welp, just ignore me then.

Edit2: Since I posted here, I might as well try to look into this matter.
First of all, we can try to debug this by --> Press F12 (open debug window)
Then try to type $gameParty.name, and see what it prints.

It should be either <Leader name> if it is a single party member or "<Leader>'s Party" if it is multiple. The only case when it returns empty is when it does not have a party member, which I'm not sure how is that even possible.
@TheoAllen I tried with a party of one, then two, then three members and the problem was in all of them. I then changed the party leader to actor 2 and it persisted.
@Kes I updated my previous post. Try to do it in the battle test or something.
@TheoAllen All it came up with is the tiny squiggle
1657893592718.png

This was with a party of 3. It gave the same result with a party of one.
@TheoAllen All it came up with is the tiny squiggle
View attachment 234744
I forgot to tell you to add "()" at the end of it so it becomes a function call (that returns a value)
@TheoAllen It now comes up with the correct name.
1657893858471.png
@Kes then what happen if you write this? BattleManager.displayDefeatMessage()
@TheoAllen This is what I get
1657894726534.png


EDIT
I still had the game running while I posted the above message. When I returned to the game there in the dialogue box was:
1657894893161.png


EDIT 2
Sadly when I played the battle to its conclusion I was back with the "was defeated"
oh, again I forgot to mention. You should look at the game, it should display the message in the message window.
Did you save your project to apply Plugin Manager changes before testing? If not, the "no plugin" test you did might still have had all plugins active.
@TheoAllen I describe that bit in the edit to my posts. I didn't see that you had posted after me.

@caethyril yes I did.
Are you using any plugins that affect combat messages?
It looks like the default Game_Party#name method checks battleMembers, which excludes hidden, a.k.a. escaped, members. If there are no members present, it returns an empty string, which is what you're seeing.

Are you using an Escape effect, or the hide() method, to remove party members from battle individually?

Edit: you could also double-check the Party Name field on the Terms tab like ScorchedGround mentioned, just in case you changed it and forgot. It's in the same list as these Victory and Defeat terms (6 lines above Victory).

Edit2: never mind, that was confirmed OK earlier. 😴
@Trihan As far as I know, no. I phrase it like that because I haven't explored all the options of all the plugins. BUT this persisted even when every single plugin was turned off, so I don't think it can be that.

@caethyril Here is the code in the damage formula for the skill that I am testing.
Code:
b.die(); b.hide(); if ($gameParty.isAllDead()) {BattleManager.processDefeat()}; 0
As you can see, the death state is added, so the actor is not just 'hidden'.
Ah, but you're using b.hide() to hide the target. The "hidden" flag is what's important here. After all, the typical defeat scenario has all members dead.

You could try adding a small plugin, e.g.
JavaScript:
/*:
 * @target MZ
 * @plugindesc Party name now includes escaped/hidden members.
 * @help Free to use and/or modify for any purpose, no credit required.
 */
Game_Party.prototype.name = function() {
    // replaced battleMembers with allBattleMembers (includes hidden members)
    const numBattleMembers = this.allBattleMembers().length;
    if (numBattleMembers === 0) {
        return "";
    } else if (numBattleMembers === 1) {
        return this.leader().name();
    } else {
        return TextManager.partyName.format(this.leader().name());
    }
};
This simply overrides the party name method with a version that uses allBattleMembers instead of battleMembers.
@caethyril What happened was that at the end of the battle I just returned straight to the map with no defeat message at all.
I tried putting it in different places in the plugin list to see if that would help, but it didn't make any difference.
@caethyril What happened was that at the end of the battle I just returned straight to the map with no defeat message at all.
I tried putting it in different places in the plugin list to see if that would help, but it didn't make any difference.
Why is your formula hiding the target and calling game over if the whole party is dead anyway?

Original thread: https://forums.rpgmakerweb.com/threads/1-was-defeated-being-overwritten.149507/