• 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!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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.

[Script] Compare Vars

Lance Koijer 2.0

Lance Koijer
  • 105
    Posts
    7
    Years
    Hi, everyone!
    Can anyone point out to me what is wrong with my script?

    Code:
    #org 0x806A4D
    lock
    countpokemon
    setvar 0x8004 0x0
    copyvar 0x8006 LASTRESULT
    goto 0x880A0DC
    
    '---------------
    #org 0x80A0DC
    comparevars 0x8004 0x8006
    if 0x2 goto 0x80A107  //checks if the number of Pokemon the player has in his party is GREATER THAN the current Pokemon slot
    setvar 0x8003 0x0
    special2 LASTRESULT 0x9 //checks ribbon of the Pokemon in slot set in var 0x8004. I'm using CFRU.
    compare LASTRESULT 0x14
    if 0x1 goto 0x880EE40 //if that Pokemon has ribbon number 20 goto 0x80EE40
    addvar 0x8004 0x1 //jumps to the next pokemon
    goto 0x880A0DC
    
    '---------------
    #org 0x80A107
    releaseall
    end
    
    '---------------
    #org 0x80EE40
    ....

    Basically, all I want to achieve there is checking the entire party if one of them has ribbon 20 (0x14) by doing a countpokemon. However, it goes immediately to 0x80A107 even though one of them has that ribbon.
     
    Back
    Top