• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - 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.

XSE Special Command to delete pokemon

  • 1
    Posts
    7
    Years
    • Seen Jul 4, 2017
    does anyone have an example of a delete Pokemon script. i need to delete a Pokemon out of a players inventory.
     
    You will need to make a quick ASM routine to do this for you. There is not a scripting command.
     
    Hello after taking a tutorial from FBI we where able to come up with just what you need.

    Here is how it works:
    Var 0x8004 value
    0x0 = Players 1st Pokemon
    0x1 = Players 2nd Pokemon
    0x2 = Players 3rd Pokemon
    0x3 = Players 4th Pokemon
    0x4 = Players 5th Pokemon
    0x5 = Players 6th Pokemon

    So you could use Special 0x9F which will let you choose the Pokemon you want deleted.
    Then callasm 0x?????? +1(where "??????" is where you placed this routine).

    C source:
    Code:
    #include <pokeagb/pokeagb.h>
    
    void delete_pokemon()
    {
        u8 slot = var_8004; // get slot id from variable
        if (slot != 5) {
            memcpy(&party_player[slot], &party_player[slot + 1], 100 * (5 - slot));
        }
        memset(&party_player[5], 0x0, 100);
        return;
    }


    Pre-Compiled version:
    Code:
    0C 4B 1B 78 10 B5 05 2B 0C D0 64 24 05 22 59 1C D2 1A 61 43 63 43 08 48 62 43 09 18 18 18 07 4B 00 F0 12 F8 64 22 00 21 05 48 06 4B 00 F0 0C F8 10 BD C0 46 C0 70 03 02 84 42 02 02 79 5E 1E 08 78 44 02 02 D9 5E 1E 08 18 47 C0 46
    Place in aligned location.

    Xse Test Script:
    Code:
    #dynamic 0x810000
    
    #org @start
    lockall
    faceplayer
    msgbox @question 0x5
    compare 0x800D 0x1
    if 0x1 goto @yes
    msgbox @no 0x6
    releaseall
    end
    
    #org @yes
    msgbox @delete 0x6
    special 0x9F
    waitstate
    callasm 0x??????+1  //make sure to change this to pointer where you put routine
    msgbox @done 0x6
    release
    end
    
    
    #org @question
    = Would you like me to delete a Pokemon?
    
    #org @delete
    =Alright then here we go!
    
    #org @done
    = There the deed has been done!
    
    #org @no
    = Maybe next time then.

    Hope this helps and credit to FBI once again.
     
    Back
    Top