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

Variable Pokémon levels?

1
Posts
8
Years
    • Seen May 25, 2015
    Hello. I have a feeling this will require a custom script, but I'll just throw it out there anyway.

    Let's say I have a trainer encounter, and that trainer has a Gengar. Is there anyway to define that Gengar's level as:

    If [Highest Level in Player Party]≤30, [Gengar Level]=30
    If [Highest Level in Player Party]>30, [Gengar Level]=[Highest Player Level]*0.9

    So basically I have a set minimum level and and a variable level that scales with the player party. In practice:

    Player's highest level is 20? Gengar is level 30
    Player's highest level is 30? Gengar is level 30
    Player's highest level is 50? Gengar is level 45
    Player's highest level is 100? Gengar is level 90

    Thanks ahead of time. I'm code illiterate so sorry if this had an obvious answer (or is impossible). I know at least one of the official games had a scaling level mechanic based on the player party levels, so I have hopes that I can pull something similar without getting too complicated.
     

    KillerMapper

    Helix Follower
    200
    Posts
    9
    Years
  • I think this can be done by making multiple version of this trainer (with a different Gengar level each time), and in the trainer event make a conditional script. I don't know how to determinate the highest level in the team, you'll probably do a script for it in order to use the conditional branch (maybe this script already exists? ).

    https://pokemonessentials.wikia.com/wiki/Party can give you infos about the party.
     
    119
    Posts
    10
    Years
    • Seen Sep 1, 2023
    I've made a small script for that, which I'm using in my own game, a while back. The code allows you to change the level of all trainer's Pokémon depending on 3 global variables. To get the functionality you want you have to check the player's Pokémon levels and set the global variables before starting the fight. Note that this applies to all fights, thus if you do not want that you have to reset them after the fight.

    Code changes are inside the spoiler:
    Spoiler:


    Note: This can indirectly change a Pokémon's moves as well. If the Pokémon's moves aren't set up for that trainer, the Pokémon will have the last 4 moves it learned (this is how essentials works). When changing the Pokémon's level, the Pokémon will learn the last 4 moves depending on its new level, not the original one. Moves set in the editor aren't changed.
     
    Last edited:
    1,224
    Posts
    10
    Years
  • I've made a small script for that, which I'm using in my own game, a while back. The code allows you to change the level of all trainer's Pokémon depending on 3 global variables. To get the functionality you want you have to check the player's Pokémon levels and set the global variables before starting the fight. Note that this applies to all fights, thus if you do not want that you have to reset them after the fight.

    Code changes are inside the spoiler:
    Spoiler:

    Note: This can indirectly change a Pokémon's moves as well. If the Pokémon's moves aren't set up for that trainer, the Pokémon will have the last 4 moves it learned (this is how essentials works). When changing the Pokémon's level, the Pokémon will learn the last 4 moves depending on its new level, not the original one. Moves set in the editor aren't changed.

    This seems a bit overcomplicated, couldn't you just use Events.onTrainerPartyLoad+=proc {|sender,e| to make a small level adjustment. Make sure to use calcStats, but if you don't reset the moves it will keep the same moves, since this modification is done after the pokemon are created.
     
    Back
    Top