• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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.

[Scripting Question] Determining correct Pokemon for level?

  • 217
    Posts
    15
    Years
    • Seen Nov 29, 2021
    So I have the following script to adjust the level of wild Pokemon:
    Code:
       if $PokemonSystem.scaling == "On"
         newlevel=pbBalancedLevel($Trainer.party)-8+rand(5)   # 8-4 levels lower
         newlevel=1 if newlevel<1
         newlevel=(PBExperience::MAXLEVEL)-20 if newlevel>(PBExperience::MAXLEVEL)-20
         pokemon.level=newlevel
         pokemon.calcStats
         pokemon.resetMoves
       end

    But a problem I'm having is that you get Pokemon levelled massively beyond when they should of evolved, or Pokemon that are too low a level to have evolved yet.

    How would I go about addressing this problem?
     
    See the code at the bottom here: https://pastebin.com/raw/0snBXTNz
    You'd use something like this to get next evolutions and apply them. Make sure to do this check before calcStats
    You can find more about checking for evolutions here: https://www.pokecommunity.com/threads/338244

    Combining these two you should be able to determine what you need. Get the evo list, and run through it, checking for levels (maybe with a bit of randomness for variation)
     
    So what I'm thinking is:
    Store the current form.
    Get the previous form.
    Store the previous form.
    Repeat until baby.
    Evolve if possible, with preference to stored forms.
    Repeat until appropriate.
     
    Back
    Top