• 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.
  • 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!
  • Akari, Selene, Mint, Solana - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Temporary steal the player's party, then give it back later

Code:
def steal_party
  $game_variables[93]=[]
  for i in 0...6
    $game_variables.push($Trainer.party[i].clone)
    $Trainer.party[i]=nil
  end
  $Trainer.party.compact!
end

def return_party
  $Trainer.party=$game_variables[93]
end

It gets more complicated if you want the player to be able to still catch Pokemon while their party is gone.
 
Oh sry thats not what I meant.
I want the player to loose his team and than gets it
back.
 
Oh sry thats not what I meant.
I want the player to loose his team and than gets it
back.

Well Rot8er_ConeX gave you a very simple script to save your party in a variable, erase your party and get it back later. You can use a script call to do it. Need a tutorial?

Oh, btw why not just use
Code:
$game_variables[90]=$Trainer.party
  $Trainer.party=[]

to save and erase the party?
 
Well Rot8er_ConeX gave you a very simple script to save your party in a variable, erase your party and get it back later. You can use a script call to do it. Need a tutorial?

Oh, btw why not just use
Code:
$game_variables[90]=$Trainer.party
  $Trainer.party=[]

to save and erase the party?

Doing it this way won't always work. That's why I used the ".clone" method above. Sometimes when you use "a=b" to set A to B, it will instead link A and B to each other so that when you edit B, it also edits A. If you do it your way, there's a very likely chance that when you run $Trainer.party=[]", it will also erase $game_variables[98], completely destroying the player's party.
 
Back
Top