• 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!
  • 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] Checking the Pokemon

Lance32497

LanceKoijer of Pokemon_Addicts
  • 792
    Posts
    10
    Years
    Hey fellas, Im thinking if it is possible in a script that will check a specific pokemon....

    Is there a XSE code for that?

    example:
    1st Script: Ill give you something nice if you can show me your RAYQUAZA?
    2nd script:(the scenario is like checking a specific pokemon when trading)
    l
     
    Hey fellas, Im thinking if it is possible in a script that will check a specific pokemon....

    Is there a XSE code for that?

    example:
    1st Script: Ill give you something nice if you can show me your RAYQUAZA?
    2nd script:(the scenario is like checking a specific pokemon when trading)
    l

    There's no single command which will do that for you, so you will have to write a proper script to achieve it. Here's a pretty quick and dirty example of how to do this with XSE's commands and no new ASM. I've added some comments to explain what is happening at certain parts of the script since it can be a bit confusing if you're new at it.

    Code:
    #dynamic 0x800000
    
    #org @start
    msgbox @talk 0x2
    countpokemon
    copyvar 0x8005 0x800D // Copying the number of Pokemon in your party to variable 0x8005
    setvar 0x8004 0x0 // 0x8004 needs to be set to 0x0 due to special 0x147's mechanics. 0x0 indicates the first Pokemon in the party, 0x1 is the second, 0x2 is the third etc.
    goto @loop
    
    #org @loop
    special2 0x8006 0x147 // Special2 0x147 saves the chosen party member's Pokemon number in the variable of your choice (0x8006)
    compare 0x8006 0x19 // Checking if the Pokemon number stored in 0x8006 is equal to 0x19 (Pikachu)
    if 0x1 goto @PikachuFound
    addvar 0x8004 0x1 // 0x8004's value is key to the script as it determines which Pokemon you're checking. When the script loops you need to check the next one in your party.
    comparevars 0x8005 0x8004 // When 0x8004 is equal to 0x8005 it you have checked every Pokemon in your party
    if 0x1 goto @NoPikachu
    goto @loop // This part of the script will continue to loop until a Pikachu is found or every Pokemon in the party has been checked
    
    #org @PikachuFound
    msgbox @YouHavePikachu 0x2
    release
    end
    
    #org @NoPikachu
    msgbox @YouDontHavePikachu 0x2
    release
    end
    
    #org @talk
    = Huh, do you have a Pikachu?
    
    #org @YouHavePikachu
    = Hooray! You caught one!
    
    #org @YouDontHavePikachu
    = Boo! I thought you had one...
     
    WOW! YOURE SO NICE ... THANKS DUDE
     
    If you are using FireRed you can use a Special2! This will work if you're looking if they own a specific species pokemon. It's only limited to that though.

    diegoisawesome said:
    I'll show an example script fragment. This is a "checkpokemon" only usable for Fire Red.

    setvar 0x8004 0x19
    special2 0x800D 0x17C
    compare 0x800D 0x1
    if 0x1 goto @have


    First, we assign the value to the variable 0x8004. Using this command, the value is the Pokemon we want to check for. In this case, it's Pikachu.
    Now, we have special2. special2 is set out like this:

    special2 [Variable to store value] [event to call]

    The event we use is 0x17C; this checks if the Pokemon that we have set to 0x8004 is in our party. If it is in our party, 0x1 is assigned to the variable, which in this case is 0x800D. If it's not in our party, 0x0 is assigned to the variable.
     
    Back
    Top