• 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 Trading Card Game 2 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.

Disable Exp Gain based on Battler's Level

hirokimura

Miltank's Fanboy Number One
  • 150
    Posts
    7
    Years
    This script will allow you to use switch to determine level capacity for pokemons without making them disobedient. Once the switch is activated, the player's pokemon wont gain any experience if they're above the specified level. You can put the wanted level depending on what you want to do with this.

    First I have to say thank you to Mamba in Pokecommunity who helped in a thread and gave me what I needed to make this work please check credits.
    Second, I have to thanks MGriffin who helped a lot by suggesting another way to make it work !

    So there will be two versions, for two slightly different purposes :

    First version using switchs with defined level capacitys. That's useful for example if like me you have a specific building in which your player can farm experience but you don't want him to train too hard. You can gradually unlock the level cap in the specific building while letting the remaining level available for him to train low level pokemons.
    To use the switch version, do the following.
    Spoiler:


    Now for the second method. It's using a variable you can customize as you like during the whole game. It's better used to easily determine a level capacity that will evolve with plot checkpoints such as badges, as it will take only 1 variable and 1 switch to control your whole game.

    Spoiler:


    Hope it will help !

    No need to credit me, however please credit Mamba since he helped me with his help in this thread https://www.pokecommunity.com/posts/9962175/, and Mgriffin who helped me developing the second version who is the more handful and clean for general usage.
     
    Last edited:
    This is neat! Can I recommend looking into using a variable to control the maximum level that is allowed to gain exp? I think it would be a little more elegant than having a bunch of variables.
     
    Well, you can do it by using only 1 switch. I put many switches in there because I have a building dedicated to training in which I gradually unlock levels that can train in it, so you just have to put one switch if you want only 1 value, unless I'm mistaken with what you want ^^
     
    I mean having something along these lines:
    Code:
    #Disable Exp Gain depending on level
    if thispoke.level>$game_variables[xxx]
      exp=0
    end
    #--------------------------------------------------
    You only need to have a single variable where you needed multiple switches, because you can put a number into a variable. You could gradually unlock levels by simply assigning a new maximum level to the variable.
     
    That's true indeed ! I didn't think about it because I need the player to be able to train pokemon with limits 10 per 10 to be able to train low level as well, but it would indeed be easier to implement this ! I'll add this tomorrow as it's midnight now xD
    Thanks for the tip, I appreciate it :)
     
    Updated version of the script including the variable method ! I kept the first method as well for specific uses, but I clearly stated when it is optimal to use it ! I put credits to you Mgriffin, thank you for the pointer !
     
    Last edited:
    Updated version of the script including the variable method ! I kept the first method as well for specific uses, but I clearly stated when it is optimal to use it ! I put credits to you Mgriffin, thank you for the pointer !

    It looks great! Don't worry about crediting me, I'm just happy to see others doing cool things! :)
     
    Back
    Top