Removing a Dead (Knocked Out) Character from Followers on Map

Discussion in 'JS Plugin Requests' started by professorbeej, Mar 9, 2019.

  1. professorbeej

    professorbeej Villager Member

    Messages:
    29
    Likes Received:
    10
    Location:
    Alabama
    First Language:
    English
    Primarily Uses:
    RMMV
    Hey, guys. I was wondering if anyone knew how to make it so that when a character is knocked out or at 0 HP, they don't show up as followers on the map.

    I found an old thread about doing it in Ruby, but I can't seem to find the JS equivalent or RMMV plugin.

    I have an event that applies knockout to 2 party members and the third has to run off to save them. But the dead characters are still leading the group on the map, so its kind of weird.

    Thanks!
     
    #1
  2. Weremole

    Weremole Veteran Veteran

    Messages:
    224
    Likes Received:
    199
    First Language:
    Swedish
    Why not just remove them from the party or disable the followers?
     
    #2
  3. OmnislashXX

    OmnislashXX Veteran Veteran

    Messages:
    595
    Likes Received:
    3,665
    Location:
    Maryland
    First Language:
    English
    Primarily Uses:
    RMMV
    If they are specific characters then just apply a Remove Party member event after the battle for the two dead members.
     
    #3
  4. gstv87

    gstv87 Veteran Veteran

    Messages:
    1,767
    Likes Received:
    798
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Code:
    Game_Followers.prototype.initialize = function() {
        this._visible = $dataSystem.optFollowers;
        this._gathering = false;
        this._data = [];
        for (var i = 1; i < $gameParty.maxBattleMembers(); i++) {
            this._data.push(new Game_Follower(i));
        }
    };
    
    Code:
        for (var i = 1; i < $gameParty.maxBattleMembers(); i++) {
            this._data.push(new Game_Follower(i));
        }
    
    Code:
      this._data = $gameParty.members().filter( function(member) {return member.isAlive()} ).map( function(actor) {return new Game_Follower(actor.actorId)})
    
    I *think*.
    I'm not familiar with map and filter blocks as I'm with their Ruby counterparts.
    but that's how I'd do it in Ruby: from Party select alive members, return one Follower per resulting ID.
    the original was: from 1 to max battle members, repeat create one Follower per database ID.
     
    #4

Share This Page