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

Level Caps Script Not Working

  • 26
    Posts
    4
    Years
    • Seen Aug 23, 2023
    I implemented a script from Pokecommunity called Easy Level Cap by ClaraDragon, since I plan to have level caps in my game. However, the script will not work, even though I put it in the correct place based on the page for the script. If I kept the bottom part of the script, I would get this error and not gain any exp, but the game wouldn't crash. However, if I remove the bottom part of the script, then the game goes as normal, but I still keep gaining exp. I really want level caps so players who play my game when I release it eventually (going to release my first game very soon, the stuff shown here is for my second game), especially since I feel like some people would get overleveled at certain points without the caps because of the level curve I'm planning the game to have. Is there a way I can fix this so I can have level caps in my game? There isn't another level caps script for v19.1. Also if the layout of the script is confusing you, and you are thinking that the first gym is level 20, the green text for badges I think relates to the amount of badges you'll have (so the cap is Level 20 if you only have one badge, cap is Level 25 if you have two badges, cap is Level 30 if you have three badges, etc).
     

    Attachments

    • [PokeCommunity.com] Level Caps Script Not Working
      level caps problem.PNG
      41.6 KB · Views: 6
    • [PokeCommunity.com] Level Caps Script Not Working
      level cap error.PNG
      26.7 KB · Views: 5
    • [PokeCommunity.com] Level Caps Script Not Working
      still gaining exp.PNG
      50.3 KB · Views: 3
    • [PokeCommunity.com] Level Caps Script Not Working
      default level cap script.PNG
      45.2 KB · Views: 3
    As I can see error message is telling you -

    unexpected end-of-input, expecting }

    ItemHandlers::UseOnPokemon.add(:RARECANDY,proc { |item,pkmn,scene|
    levelCap=15
    levelCap=25 if $game_switches[4] #1 badge
    levelCap=35 if $game_switches[6] #2 badge
    levelCap=40 if $Trainer.numbadges>=2 #3 badge
    levelCap=45 if $Trainer.numbadges>=3 #4 badge
    levelCap=50 if $game_variables[8]==1 #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
    if pkmn.level>=GameData::GrowthRate.max_level || pkmn.shadowPokemon? || pkmn.level>=levelCap
    scene.pbDisplay(_INTL("It won't have any effect."))
    next false
    end
    pbChangeLevel(pkmn,pkmn.level+1,scene)
    scene.pbHardRefresh
    next true
    })

    You don't need this part, and in fact will get more errors by keeping it in.

    if defined?(pkmn) #check if the pkmn variable exist, for v18 and v19 compatibility
    thispoke = pkmn
    end
    exp=levelCapExp if (thispoke.level >= levelCap) && exp>levelCapExp


    Regards,
    J Wick (Developer and QuickBooks Hosting expert)
     
    The things is that I'll still gain exp at the intended level cap if I remove the botton part. But if I keep the bottom part, I won't gain exp even at Level 12, a level below the cap for first gym.
     
    Back
    Top