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

[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