• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Remove Pokemon party

  • 57
    Posts
    5
    Years
    • Seen Apr 17, 2022
    Well, as the title says, I want to have the pokemons removed from the player in one part, and then return them to him. I don't have much idea of how to do it, so I ask you. What would be the way to do it? (If possible, of course) (If you can explain it for newbies, I would appreciate it)

    Thanks in advance
     
    Whenever you want to clear the trainer's party, you should first save the entire party to a variable (replace X with the id of a free variable slot):
    Code:
    $game_variables[X] = $Trainer.party.map { |e| e.clone }
    $Trainer.party.clear

    Then later on, whenever you want to restore that party:
    Code:
    $Trainer.party = $game_variables[X]
     
    Back
    Top