Remove all party members?

Discussion in 'RPG Maker MV' started by captainette777, Sep 28, 2018.

  1. captainette777

    captainette777 Mad Scientist Veteran

    Messages:
    78
    Likes Received:
    72
    Location:
    Alternate timeline
    First Language:
    English
    Primarily Uses:
    RMMV
    Hey all, I want to have an event where I want everybody in the party is removed, making the party empty, regardless of who they are. Having the event command just say "remove party member x" over and over again gets really inefficient when you have a ton of actors in your game. Is there a script for this? I googled for it and got results for VX Ace, but not MV.
     
    #1
  2. Poryg

    Poryg Dark Lord of the Castle of Javascreeps Veteran

    Messages:
    3,928
    Likes Received:
    9,925
    Location:
    Czech Republic
    First Language:
    Czech
    Primarily Uses:
    RMMV
    $gameParty._members = []; Maybe you will have to empty $gameParty._battleMembers like that too.
     
    #2
  3. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,600
    Likes Received:
    1,005
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    I believe it's $gameParty._actors

    Though I feel like there could be some side-effects of having a completely empty party...
     
    #3
  4. Zarsla

    Zarsla Veteran Veteran

    Messages:
    688
    Likes Received:
    201
    First Language:
    English
    You can do it, but the games gonna end up crashing, if you do.
     
    #4
  5. captainette777

    captainette777 Mad Scientist Veteran

    Messages:
    78
    Likes Received:
    72
    Location:
    Alternate timeline
    First Language:
    English
    Primarily Uses:
    RMMV
    Hmm. So I would just put that in the script event to make it work, right?

    Hearing both of you guys, I have this idea that I'll run this script, but then immediately run the "Add Party Member" script to add a party member with no data in it to make it appear that no one is there. Would that work?
     
    #5
  6. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,089
    Likes Received:
    12,265
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Create a common event which runs remove party x for every party member you can ever have. That way you only create it once.
     
    #6
    captainette777 likes this.
  7. BK-tdm

    BK-tdm Manga Maker Veteran

    Messages:
    73
    Likes Received:
    56
    First Language:
    English
    Primarily Uses:
    RMMV
    What do you need an empty party for? Because having 0 actors will probably end up crashing since by logic you wont have a player character to move or interact either, even if you add an invisible actor the pause menu will show an empty character bust/face/sprite but it will still have stats and hp/mp bars, you're trying to make a "party split up" kind of event?
     
    #7
  8. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,600
    Likes Received:
    1,005
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    There's only one way to find out, right? (by testing ;))

    You can also run something like this which removes all actors except for one. Replace X with the actor ID # that you want to keep. Note this syntax is for MV 1.6+.
    Code:
    $gameParty._actors = $gameParty._actors.filter(actor => actor.actorId() === X);
    $gamePlayer.refresh();
    $gameMap.requestRefresh();
    
     
    #8
    captainette777 likes this.

Share This Page