• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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
    2
    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.
     
    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.
     
    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 !
     
    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;
    }
     
    Thanks a lot, it works perfectly ! I understand better now how it works, didn't know about the ZeroPlayerPartyMons() function.
     
    Back
    Top