• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Pokédex rating script

423
Posts
13
Years
    • Seen Aug 31, 2023
    ok i do know that there is a common event example in essentials for calling prof oak to get a rating but I made this before i realized so if anyone would like to use it then feel free if not then dont

    Code:
    def pbdexrate
      Kernel.pbMessage(_INTL("You have Own {1} Pokémon and you Seen {2} Pokémon",$Trainer.pokedexOwned,$Trainer.pokedexSeen))
      $game_variables[27] = $Trainer.pokedexOwned
      $game_variables[28] = $Trainer.pokedexSeen
      if $game_variables[27] == PBSpecies.maxValue
        Kernel.pbMessage(_INTL("Your PokéDex is entirely complete Congratulations!"))
      else
        if $game_variables[27] > (PBSpecies.maxValue / 100) * 90
          Kernel.pbMessage(_INTL("Outstanding! You've become a real pro at this!"))
        else
          if $game_variables[27] > (PBSpecies.maxValue / 100) * 80
            Kernel.pbMessage(_INTL("I'm impressed! It must have been difficult to do!"))
          else
            if $game_variables[27] > (PBSpecies.maxValue / 100) * 70
              Kernel.pbMessage(_INTL("Wonderful!"))
            else
              if $game_variables[27] > (PBSpecies.maxValue / 100) * 60
                Kernel.pbMessage(_INTL("Very good!"))
              else
                if $game_variables[27] > (PBSpecies.maxValue / 100) * 50
                  Kernel.pbMessage(_INTL("OH! This is getting even better!")) 
                else
                  if $game_variables[27] > (PBSpecies.maxValue / 100) * 40
                    Kernel.pbMessage(_INTL("Looking good!"))
                  else
                    if $game_variables[27] > (PBSpecies.maxValue / 100) * 30
                      Kernel.pbMessage(_INTL("Good, you're trying hard!"))
                    else
                      if $game_variables[27] > (PBSpecies.maxValue / 100) * 20
                        Kernel.pbMessage(_INTL("You still need more POKéMON!"))
                      else
                        if $game_variables[27] > (PBSpecies.maxValue / 100) * 10
                          Kernel.pbMessage(_INTL("You're on the right track!"))
                        else
                          Kernel.pbMessage(_INTL("You still have lots to do. Look for POKéMON in grassy areas!"))
                        end
                      end
                    end
                  end
                end
              end
            end
          end
        end
      end
    end
    what this script does is checks how many species there are and gives you a new message for around every 10% caught
     
    42
    Posts
    13
    Years
  • But what's the meaning of this since the Prefix is [Question]?

    Sharing your script should be in category [Add-On], now [Question] or w/e :P
     
    423
    Posts
    13
    Years
    • Seen Aug 31, 2023
    errrr because i hadnt realised i selected a prefix my bad can that be changed???
     

    FL

    Pokémon Island Creator
    2,454
    Posts
    13
    Years
    • Seen May 16, 2024
    OMG! This code can be very optimized! For better code optimizations you can use elsif or case/when
    Code:
    def pbdexrate
      Kernel.pbMessage(_INTL("You have Own {1} Pokémon and you Seen {2} Pokémon",$Trainer.pokedexOwned,$Trainer.pokedexSeen))
      $game_variables[27] = $Trainer.pokedexOwned
      $game_variables[28] = $Trainer.pokedexSeen
      if $game_variables[27] == PBSpecies.maxValue
        Kernel.pbMessage(_INTL("Your PokéDex is entirely complete Congratulations!"))
      elsif $game_variables[27] > (PBSpecies.maxValue / 100) * 90
        Kernel.pbMessage(_INTL("Outstanding! You've become a real pro at this!"))
      elsif $game_variables[27] > (PBSpecies.maxValue / 100) * 80
        Kernel.pbMessage(_INTL("I'm impressed! It must have been difficult to do!"))
      elsif $game_variables[27] > (PBSpecies.maxValue / 100) * 70
        Kernel.pbMessage(_INTL("Wonderful!"))
      elsif $game_variables[27] > (PBSpecies.maxValue / 100) * 60
        Kernel.pbMessage(_INTL("Very good!"))
      elsif $game_variables[27] > (PBSpecies.maxValue / 100) * 50
        Kernel.pbMessage(_INTL("OH! This is getting even better!")) 
      elsif $game_variables[27] > (PBSpecies.maxValue / 100) * 40
        Kernel.pbMessage(_INTL("Looking good!"))
      elsif $game_variables[27] > (PBSpecies.maxValue / 100) * 30
        Kernel.pbMessage(_INTL("Good, you're trying hard!"))
      elsif $game_variables[27] > (PBSpecies.maxValue / 100) * 20
        Kernel.pbMessage(_INTL("You still need more POKéMON!"))
      elsif $game_variables[27] > (PBSpecies.maxValue / 100) * 10
        Kernel.pbMessage(_INTL("You're on the right track!"))
      else
        Kernel.pbMessage(_INTL("You still have lots to do. Look for POKéMON in grassy areas!"))             
      end
    end
    I prefer this way:
    Code:
    def pbdexrate
      Kernel.pbMessage(_INTL("You have Own {1} Pokémon and you Seen {2} Pokémon",$Trainer.pokedexOwned,$Trainer.pokedexSeen))
      pokedexPercent = ($Trainer.pokedexOwned*100)/PBSpecies.maxValue
      message = case pokedexPercent
        when 0..9 then _INTL("You still have lots to do. Look for POKéMON in grassy areas!")
        when 10..19 then _INTL("You're on the right track!")
        when 20..29 then _INTL("You still need more POKéMON!")
        when 30..39 then _INTL("Good, you're trying hard!")
        when 40..49 then _INTL("Looking good!")
        when 50..59 then _INTL("OH! This is getting even better!")
        when 60..69 then _INTL("Very good!")
        when 70..79 then _INTL("Wonderful!")
        when 80..89 then _INTL("I'm impressed! It must have been difficult to do!")
        when 90..99 then _INTL("Outstanding! You've become a real pro at this!")
        else _INTL("Your PokéDex is entirely complete Congratulations!")
      end 
      Kernel.pbMessage(message)
    end
    Probably this can be optimizate even more eliminating the pokedexPercent variable, but this way is good enough.
     
    423
    Posts
    13
    Years
    • Seen Aug 31, 2023
    thank guys im still learning scripting so help optimising stuff would be great help sooo thank you again
     
    Back
    Top