• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

How do I remove Pokémon?

Marohak

Asker of Dumb Questions
25
Posts
10
Years
  • I'm writing an event, where a thug steals your Pokémon.

    I want to remove all Pokémon, except the first Pokémon.

    And also, if the player has only one Pokémon, I want a separate event to occur.

    Any suggestions?
     

    Marohak

    Asker of Dumb Questions
    25
    Posts
    10
    Years
  • I've had a look, but I don't fully understand which script in supposed to use and how.

    Was hoping to get some clarity here.
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    This way is long, but requires no scripting knowledge, just basic understanding of variables and Essentials commands... Which I assume you know about.

    Create up to 5 variables (let's say 51-55 for this examples sake).
    then in the event, have it call this:
    Code:
    game_variables[51]=$Trainer.party[1]
    game_variables[52]=$Trainer.party[2]
    game_variables[53]=$Trainer.party[3]
    game_variables[54]=$Trainer.party[4]
    game_variables[55]=$Trainer.party[5]
    At which point, you'll want to remove any Pokémon after position 1, so use:
    Code:
    $Trainer.party.delete_at(5)
    $Trainer.party.delete_at(4)
    $Trainer.party.delete_at(3)
    $Trainer.party.delete_at(2)
    $Trainer.party.delete_at(1)
    You'll be left with 1 Pokémon and your other 5 will be stolen lol.
    Remember though... You'll want to check a Pokémon exists in each of the positions, otherwise you will receive an error... So you SHOULD, have it look like this:
    Code:
    Conditional Branch: Trainer.party.length>5
    Script:             $Trainer.party.delete_at(5)
    end
    Conditional Branch: Trainer.party.length>4
    Script:             $Trainer.party.delete_at(4)
    end
    And you get the idea with that.
    To recall your team, do this again, somewhat, in reverse... Minus a few steps.
     
    Back
    Top