• 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.

[Other] Ways to remove Pokemon from the player’s party

  • 2
    Posts
    1
    Years
    • Seen Apr 21, 2023
    I was hoping someone could explain how I'd be able to remove Pokémon from the player's party, specifically with pokeemerald. I looked all over for any threads or resources on this subject, but none were relevant.
     

    Lunos

    Random Uruguayan User
  • 3,117
    Posts
    15
    Years
    I was hoping someone could explain how I'd be able to remove Pokémon from the player's party, specifically with pokeemerald. I looked all over for any threads or resources on this subject, but none were relevant.
    There's a function to delete the data of a Pokémon in a party. It's called ZeroMonData
    You just have to write a special function, or alternatively a void function to call using callnative, that makes use of it.
    Something like:
    Code:
    void DeleteChosenPartyMon(void)
    {
        if (gSpecialVar_0x8004 != PARTY_SIZE)
        {
            ZeroMonData(&gPlayerParty[gSpecialVar_0x8004]);
            CompactPartySlots();
        }
    }

    This example would be used alongside the special ChoosePartyMon inside an overworld script to delete the Pokémon chosen by the Player.
    Of course, you can modify it and make it suit your needs.
     
  • 13
    Posts
    346
    Days
    • Seen Mar 29, 2024
    Hello, I'm actually new in scripting. What I want to do is talk to a npc that deletes automatically every pokemon in my team, leaving you with 0 pokemons. How can you do that ? Can I use the 'DeleteChosenPartyMon' function that you suggested ? If so, where should I store it, and how can I call such a function in my scripts ? I'm still a bit confused on how to make this work. Thanks !
     
  • 465
    Posts
    6
    Years
    • Seen today
    Hello, I'm actually new in scripting. What I want to do is talk to a npc that deletes automatically every pokemon in my team, leaving you with 0 pokemons. How can you do that ? Can I use the 'DeleteChosenPartyMon' function that you suggested ? If so, where should I store it, and how can I call such a function in my scripts ? I'm still a bit confused on how to make this work. Thanks !

    To use a custom C function in an event script you just need to add the C function to any C source file (src/script_pokemon_util.c would likely be the most fitting one), and call it with the callnative command in a script. For example, "callnative DeleteChosenPartyMon" would be used to run the function Lunos posted.

    While you could call DeleteChosenPartyMon several times to clear the party, you could also do it more efficiently with just a single function call:
    Code:
    void ClearPlayerParty(void)
    {
        ZeroPlayerPartyMons();
        gPlayerPartyCount = 0;
    }
     
  • 13
    Posts
    346
    Days
    • Seen Mar 29, 2024
    Thanks a lot, it works perfectly ! I understand better now how it works, didn't know about the ZeroPlayerPartyMons() function.
     
    Back
    Top