• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

Pokemon Level Balance Script

  • 1,748
    Posts
    15
    Years
    As the title suggests it balances the level of Pokemon. Well to be more precisely; it balances pokemon that the player does not own.

    For this script to work you'll need to activate a switch. (Read the comments on how to change the Switch ID)

    Code:
    ################################################################################
    # Pokemon Level Balancing
    # By Umbreon
    ################################################################################
    # Balances any and all pokemon's levels towards the player's party level.
    #
    # NOTE: This won't affect any pokemon the player owns.
    #
    # To use: simply activate Switch Number X
    #  (X = the number listed After "Switch = ", default is switch number 37.)
    #
    #
    ################################################################################
    
    
    module LevelBalance
      Switch = 37 # The switch used to activate/deactivate the level balancing
    end
    
    class PokeBattle_Pokemon
      
      alias balanced_level_init initialize
      
      def initialize(species,level,player=nil,withMoves=true)
        
        if $game_switches && $game_switches[LevelBalance::Switch] && $Trainer &&
          $Trainer.party.length > 0
          level = pbBalancedLevel($Trainer.party)
        end
        
        balanced_level_init(species, level, player, withMoves)
      end
    end
     
    So you're saying that trainers will have pokemon that will change evolutionary lines and moves when this switch is activated?

    No, I'm saying that any Wild/Trainer pokemon you encounter will have a balanced out level of your party.

    So basically if you have a party of level 1s your enemy will also have a party of level 1 pokemon.

    Pokemon like charizard will not turn into charmander.

    But the same logic goes as a charmander will never turn into a charizard from this script.
     
    No, I'm saying that any Wild/Trainer pokemon you encounter will have a balanced out level of your party.

    So basically if you have a party of level 1s your enemy will also have a party of level 1 pokemon.

    Pokemon like charizard will not turn into charmander.

    But the same logic goes as a charmander will never turn into a charizard from this script.

    Ah, I thought so, but I saw species and level, and got my hopes up
     
    Ah, I thought so, but I saw species and level, and got my hopes up

    You see species there because I made an override onto the initialize script of PokeBattle_Pokemon. (which the initialization takes species, level, trainer, and a bool determining whether or not to add moves to the pokemon)
     
    I'm not great at scripting so this may be a question with an obvious answer but could I modify this to just affect wild Pokémon and not trainers?
     
    This is a late reply, but...

    I'm not great at scripting so this may be a question with an obvious answer but could I modify this to just affect wild Pokémon and not trainers?
    You can actually already do this in version 13 without adding a new script. Look in PokemonEncounterModifiers, and find the following code, in the bottom of the script section:

    Code:
    #Events.onWildPokemonCreate+=proc {|sender,e|
       pokemon=e[0]
       if $game_map.map_id==51
         pokemon.level=pbBalancedLevel($Trainer.party) - 4 + rand(5)   # For variety
         pokemon.calcStats
         pokemon.resetMoves
       end
    }

    Change map_id (in this case "51") to any map number where you want the script to apply.

    You could use an array to make it apply to multiple maps, for example:
    Code:
       if $game_map.map_id==[22,33,51]

    Or, of course, you could just make it apply to all wild pokémon everywhere.

    Anyway, you can also change "pbBalancedLevel" to "pbTopLevel" if you want the wild pokémon to be based the highest level in the player's party, and not the average level. That works better, in my opinion. (You'd need to have a little more setup to make that work right, though.)
     
    Last edited:
    This is a late reply, but...


    You can actually already do this in version 13 without adding a new script. Look in PokemonEncounterModifiers, and find the following code, in the bottom of the script section:

    Code:
    #Events.onWildPokemonCreate+=proc {|sender,e|
       pokemon=e[0]
       if $game_map.map_id==51
         pokemon.level=pbBalancedLevel($Trainer.party) - 4 + rand(5)   # For variety
         pokemon.calcStats
         pokemon.resetMoves
       end
    }

    Change map_id (in this case "51") to any map number where you want the script to apply.

    You could use an array to make it apply to multiple maps, for example:
    Code:
       if $game_map.map_id==[22,33,51]

    Or, of course, you could just make it apply to all wild pokémon everywhere.

    Anyway, you can also change "pbBalancedLevel" to "pbTopLevel" if you want the wild pokémon to be based the highest level in the player's party, and not the average level. That works better, in my opinion. (You'd need to have a little more setup to make that work right, though.)

    Could I make it depend on a variable? The game I'm making allows you to challenge any of the gym leaders in any order, and the game should balance itself around how many badges you have. Is there any way I can achieve this without too much modification to the scripts?
     
    thanks for the script! i've created this version:
    Code:
    module LevelBalance
      Switch = 81 # The switch used to activate/deactivate the level balancing
    end
    
    class PokeBattle_Pokemon
      
      alias balanced_level_init initialize
      
      def initialize(species,level,player=nil,withMoves=true)
        
        if $game_switches && $game_switches[LevelBalance::Switch] && $Trainer &&
          $Trainer.party.length > 0
          #level = pbBalancedLevel($Trainer.party) #original version
          level = $Trainer.numbadges*10+ rand(5)
        end
        
        balanced_level_init(species, level, player, withMoves)
      end
    end

    levels are balanced around the number of badges!
     
    Hey there, if you dont mind, where exactly do I add this piece of script? Do i plug it in above "main", add it in with "pfield_encountermodifiers", or somewhere in "NPC_Trainers"?
     
    Is it also possible to balance your party to your encounter? Like i have a charizard lvl 55 but i fight a trainer with a lvl5 pokemon my char izard will be lvl 5 also?
     
    Is it also possible to balance your party to your encounter? Like i have a charizard lvl 55 but i fight a trainer with a lvl5 pokemon my char izard will be lvl 5 also?

    No. If you have a charizard lvl 55 and fight to a trainer with a lvl 5 pokemon, that pokemon will be a lvl 50~60.

    Your PT lvl dont be affect by that script. Only lvl to wild encounter and trainers battle.

    EDIT:

    So, take a look to that script, its a little better:
    https://www.pokecommunity.com/showthread.php?t=409828
     
    Last edited:
    So I know this thread is old, but maybe someone can still help me. I'm essentially trying to get this script, but with something added to evolve the pokemon as well. I tried the one by Joltik, however it doesn't quite meet my needs. I like the balancing this script gives more. Any help would be appreciated
     
    Back
    Top