How to not allow a dead character to lead party

I have a battle system where you have a party of anywhere between 1-6 (2 out at a time) characters using YEP Party System plugin. How do I make it so if one dies, he can't walk around the map anymore? Right now, even if they're fainted/dead, if they're still in slot #1, they're the one walking around the world.

Thanks in advance, fellas.
You could make a parallel process common event that checks whether any party member has the "death" status and if so removes them from the party and adds them back in, which would result in the next member up being the one on the map.
Not familiar with the use of the party system plugin, but I use eventing for my game.

I have an auto-run common event that checks the party for casualties and removes them from the party after a battle.

The event is triggered by setting a switch in the battle event bit of each troop. The settings I use are "Turn 0", "Battle" and a switch which is kept on once the opening sequence of the game is complete.

Hint You might find it a good idea to turn the switch that initiates the autorun casualty-clear up event off as the last item of the casualty clear-up event. Please don't ask me how I know this. :LZYblush:

I also use Hidden Items type A with the names of my actors to help keep track of characters that have been killed off in the line of duty.
The way I did it was basically with a plugin - the graphic shown becomes the frontmost living character in the party. If that's what you want, you can paste this code into a plugin (call it whateverYouWant.js):

JavaScript:
(function() {
    Game_Party.prototype.leader = function() {
        return (this.isAllDead() ? this.members()[0] : this.aliveMembers())[0];
    };
    const old_die = Game_Actor.prototype.addNewState;
    Game_Actor.prototype.addNewState = function(id) {
        old_die.call(this, id);
        if(id == this.deathStateId())
            $gamePlayer.refresh();
    };
    const old_revive = Game_Actor.prototype.eraseState;
    Game_Actor.prototype.eraseState = function(id) {
        old_revive.call(this, id);
        if(id == this.deathStateId())
            $gamePlayer.refresh();
    };
})()

This method doesn't change the ordering of your party members, so if the leader dies, they're still in the leader position, but they won't be the one running around the map. I don't think it'll work correctly if you use followers, but I'm sure there's something that could be done about that if you need it.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-not-allow-a-dead-character-to-lead-party.123376/