How to memorize a party?

Discussion in 'RPG Maker MV' started by Kelphy, Jan 11, 2019.

  1. Kelphy

    Kelphy Veteran Veteran

    Messages:
    81
    Likes Received:
    5
    First Language:
    English
    It's not plugin report at all, that was a suggestion that someone else gave me. I was responding to that. I was quoting my previous message because they must have missed it was all. Sorry about that.

    I got your idea to work! Thanks! I think there was something messy in my events making it not work. But when I did it on a separate event it worked perfectly. So I think I will just try with that.

    Edit: Oh and thank you!!!!
     
    #21
  2. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    345
    Likes Received:
    603
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    It doesn't remove them from your party. You don't need to remove anyone from your party actually !
    But it should remove them from the "battle party".

    Works for me but I just realised the $gameParty._battleMembers data actually cames from one of the plugins I'm using (probably Yanfly's). Sorry if it doesn't work for you :s
     
    #22
  3. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,795
    Likes Received:
    7,616
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    @Kelphy Okay, that's why I was asking. (Haven't had my coffee yet.)

    Is this solved then?
     
    #23
  4. Bex

    Bex Veteran Veteran

    Messages:
    1,262
    Likes Received:
    292
    First Language:
    German
    Primarily Uses:
    RMMV
    Because maybe he can only specify 8 of his 20 or more actors in there.
    But he should use this to have the id of the first 4 Actors in Party, and than 20 branches if the other actors are in current party or not, than 20 switches to specify if those actors are in the party, that after removing them, we can know which to readd back to Party.

    I read in this Thread about changing Battle Party size with Eventcommand Script, i would try that first in your case.
     
    #24
  5. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    345
    Likes Received:
    603
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    Actually, i just tryed it and it works. You get your followers back when you switch back to 4. Not sure why it's not working for you.
     
    #25
  6. VeryXInh

    VeryXInh Veteran Veteran

    Messages:
    90
    Likes Received:
    114
    First Language:
    Japanese
    Primarily Uses:
    RMXP
    Because she removed them manually already perhaps
     
    #26
  7. OmnislashXX

    OmnislashXX Veteran Veteran

    Messages:
    595
    Likes Received:
    3,665
    Location:
    Maryland
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm actually curious about this as well, because I have a Battle Tutorial that eventually I will need to remove the characters of the whole party and replace them with Actors so as to not have them leveled up. Then I'll have to replace the party members back.
     
    #27
  8. IceDragon

    IceDragon Elder Cookie Dragon Veteran

    Messages:
    73
    Likes Received:
    60
    Location:
    Jamaica
    First Language:
    English
    Primarily Uses:
    N/A
    So your question is, how can you remember all the party members at a particular time and then restore them after the battle.

    Seeing as javascript doesn't have private members, you can actually just store the `$gameParty.actors` (which are cleanly serializable since it's just their ids)

    So the first thing you need is:
    Code:
    // In a script command
    const partyMemoryID = 2; // or whatever you feel like
    const originalActorIDs = $gameParty._actors;
    $gameVariables.setValue(partyMemoryID, originalActorIDs /* This is a list of actor ids, safely serializable */);
    $gameParty._actors = []; // Erase the actors, equivalent to clearing the party
    $gameParty._actors[0] = originalActorIDs[0]; // Restore the leader of the party
    
    /* Run the battle scene */
    
    /* Afterwards, to restore the original party in another script command */
    const partyMemoryID = 2;
    $gameParty._actors = $gameVariables.value(partyMemoryID);
    
    Please note, I do not have a copy of RPG Maker MV, I just eyeballed the code from the demo (years old)
     
    #28
    Aloe Guvner likes this.
  9. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    345
    Likes Received:
    603
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    Here's an exemple : ex_battle_rest.png
    You really don't need anything else for your main character to fight alone (no need to save the party, no need to remove anyone).
     
    #29

Share This Page