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

Pokemon Essentials V21 Level Caps

2
Posts
164
Days
    • Seen Feb 26, 2024
    Hi all, I have been looking around on google for a couple days now for a level cap system that will work on Pokémon essentials v21 and I am coming up short so I thought id make an account and post a thread myself so I apologise in advance for any way I do not use this site correctly as I am new :).

    So my issue: As the title suggests I am trying to implement a level cap system to my Pokémon essentials v21 fan game. I have looked around online and found a couple different methods for doing this however they either: do not work with v21 sadly ((broken link removed)) or don't seem to work with the gen 8 items expS, expL, ect... (https://www.pokecommunity.com/threads/easy-levelcap-v16-v17-v18-v19.452355/). I was wondering if anyone has a solution to level caps in v21 or if they could attempt helping me tweak one of these other methods to work with the new items.

    thanks in advance for any help someone can provide :)
    look forward to hearing from you
     
    2
    Posts
    164
    Days
    • Seen Feb 26, 2024
    So I've been messing around with the scripting and have edited the Rare Candy function in a way that allows multiple rare candies to be used at once. I am unsure if I will be able to make the xp candies function however.

    I have used the level cap code from ClaraDragon and added a recursive loop to allow for the multiple rare candies to be used. The function below is a complete replacement of the Rare candy function at Line 922 of the Item_Effects script as of version v21.1
    Ruby:
    ItemHandlers::UseOnPokemon.add(:RARECANDY, proc { |item, qty, pkmn, scene|
      if pkmn.shadowPokemon?
        scene.pbDisplay(_INTL("It won't have any effect."))
        next false
      end
      levelCap=15
        levelCap=25  if $game_switches[4]     #1 badge
        levelCap=35  if $game_switches[5]     #2 badge
        levelCap=40  if $game_switches[6]     #3 badge
        levelCap=45  if $game_switches[7]     #4 badge
        levelCap=50  if $game_switches[8]     #5 badge
        levelCap=55  if $game_switches[9]     #6 badge
        levelCap=60  if $game_switches[10]    #7 badge
        levelCap=75  if $game_switches[11]    #8 badge
        levelCap=100 if $game_switches[12]    #E4
      until qty <= 0
        if pkmn.level >= GameData::GrowthRate.max_level || pkmn.level>=levelCap
          new_species = pkmn.check_evolution_on_level_up
          if !Settings::RARE_CANDY_USABLE_AT_MAX_LEVEL || !new_species
            scene.pbDisplay(_INTL("It won't have any effect."))
            break
            next false
          end
          # Check for evolution
          pbFadeOutInWithMusic do
            evo = PokemonEvolutionScene.new
            evo.pbStartScreen(pkmn, new_species)
            evo.pbEvolution
            evo.pbEndScreen
            scene.pbRefresh if scene.is_a?(PokemonPartyScreen)
          end
          next true
        end
        # Level up
        pbSEPlay("Pkmn level up")
        pbChangeLevel(pkmn, pkmn.level + 1, scene)
        $bag.remove(:RARECANDY)
        scene.pbHardRefresh
        qty -= 1
      end
    })

    I'm sure this code is far from perfect but it works XD and that's good enough for me, let me know if you try this out and run into some problems. It has been working perfectly for me so far.
     
    Last edited:
    Back
    Top