• 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!
  • Cyndy, May, Hero (Conquest), or Wes - 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.

[Scripting Question] Pokemon Party

  • 12
    Posts
    6
    Years
    • Seen Jun 25, 2020
    HI pokecommunity! Friends

    Today I bring they a doubt and maybe someone can help me with it .. in my project of Pokémon Essentials, I try before a battle with a rival trainer realice a validation of the player's team, to know which is the Pokémon with the highest level... then save it in a variable and select that level for all pokémon of the rival trainer ..
    then try to validate with:
    Code:
    [COLOR="DarkRed"]pbFirstAblePokemon(1)[/COLOR]

    Last using with each pokemon of the party:
    Code:
    [COLOR="DarkRed"]pkmn=pbGetPokemon
    pbSet(2,pkmn.level)[/COLOR]

    But I do not know how to verify the whole group and compare to find out which is the highest level ... and then save that level in a variable.
    How do they do it or what would you do? Thanks in advance. ☺️
     
    Last edited:
    I use this to get the highest level Pokemon and store it in a variable

    Code:
    def pbHighestLevel
    max = 0
    for i in 0...$Trainer.party.length
    if $Trainer.party[i].level >max
    max = $Trainer.party[i].level
    end
    $game_variable [28] = max
    end
    end
     
    Last edited:
    I use this to get the highest level Pokemon and store it in a variable
    Code:
    def pbHighestLevel
    max = 0
    for i in 0...$Trainer.party.length
    if $Trainer.party[i].level >max
    max = $Trainer.party[i].level
    end
    $game_variable [28] = max
    end
    end

    Ohhh super!! is exactly what I wanted to achieve Arachnee you are my hero!
     
    Last edited:
    Back
    Top