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

Leveling Enemies Up.

6
Posts
11
Years
    • Seen Oct 30, 2014
    Okay.
    So I want enemy trainers to 'level up' with the players.

    For example if the highest Pokemon in a players party is 62 all trainers would have Pokemon around level 60.

    I have a few ideas about how to do this but I can only seem to be able to calculate the mean of the players party not find the highest level poke. I want the highest pokemon to count because I want to discourage raising 1 Pokemon mega high and blitzing through the game against medium level pokemon.

    So

    1) Is there any way to return the highest current party member?

    2) Is there any way to use that information to manipulate trainers?

    Any suggestions or ideas would be helpful!
    Thanks
     
    6
    Posts
    11
    Years
    • Seen Oct 30, 2014
    Thanks!
    That's an interesting thread.
    I've worked out how to get all my trainers to roughly the level of the player using the weighted mean of the party script.
    It's working well enough for the moment as the weighted mean counts higher level pokemon much more than lower levels.
    If anyone does know the command to return the highest level in the party that would be great.
     

    FL

    Pokémon Island Creator
    2,449
    Posts
    13
    Years
    • Seen Apr 30, 2024
    Thanks!
    That's an interesting thread.
    I've worked out how to get all my trainers to roughly the level of the player using the weighted mean of the party script.
    It's working well enough for the moment as the weighted mean counts higher level pokemon much more than lower levels.
    If anyone does know the command to return the highest level in the party that would be great.
    Code:
    def highestLevelInParty
    ret=0
    for pokemon in $Trainer.pokemonParty
      ret=pokemon.level if pokemon.level>ret
    end
    return ret

    Call highestLevelInParty
     
    3
    Posts
    6
    Years
    • Seen Jan 1, 2024
    Code:
    def highestLevelInParty
    ret=0
    for pokemon in $Trainer.pokemonParty
      ret=pokemon.level if pokemon.level>ret
    end
    return ret

    Call highestLevelInParty

    Hey,
    where do I have to put this in excatly?
     
    Last edited:
    11
    Posts
    6
    Years
  • Code:
    def highestLevelInParty
    ret=0
    for pokemon in $Trainer.pokemonParty
      ret=pokemon.level if pokemon.level>ret
    end
    return ret

    Call highestLevelInParty

    Hi there, would you please tell me what file I have to edit and copy this to make it works? I really don't have experience in this, I'm new here.
     

    FL

    Pokémon Island Creator
    2,449
    Posts
    13
    Years
    • Seen Apr 30, 2024
    Hi there, would you please tell me what file I have to edit and copy this to make it works? I really don't have experience in this, I'm new here.
    Open the script menu. Copy the first code on a new script section above "main". After this, follow this thread. But, instead of 'pbBalancedLevel($Trainer.party)', use 'highestLevelInParty'.

    I aren't sure if this code is still working, since it is an old code.
     
    Last edited:

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • It's giving me a syntax error. Does that mean it doesn't work?

    If you are copying what FL posted, he just forgot to put an 'end' into the final of code, that is why you got the error:
    Code:
    def highestLevelInParty
      ret=0
      for pokemon in $Trainer.pokemonParty
        ret=pokemon.level if pokemon.level>ret
      end
      return ret
    end
     
    4
    Posts
    4
    Years
    • Seen Apr 23, 2020
    Thank you so much. It was very kind of you to reply to such an old thread that I honestly did not expect to get a response from. I tried it with the new code and this time I was allowed in the game but as soon as I got into an encounter this message popped up.
    ---------------------------
    Pokemon Essentials
    ---------------------------
    [Pokémon Essentials version 17.2]
    Exception: NoMethodError
    Message: undefined method `pbhighestLevelInParty' for nil:NilClass
    PField_EncounterModifiers:24
    PField_EncounterModifiers:20:in `call'
    EventHandlers:54:in `trigger'
    EventHandlers:49:in `each'
    EventHandlers:49:in `trigger'
    PField_Encounters:365:in `pbGenerateWildPokemon'
    PField_Battles:88:in `pbWildBattle'
    PField_Field:387:in `pbBattleOnStepTaken'
    PField_Field:368:in `pbOnStepTaken'
    Game_Player:461:in `update_old'

    If you have any ideas on how to fix this it would be greatly appreciated.
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • Message: undefined method `pbhighestLevelInParty' for nil:NilClass
    If you read your error is just because the script didn't find 'def pbhighestLevelingParty'. Maybe you need to add 'pb' before 'highestLevelingParty'. Double check what FL posted anyway.

    Code:
    Open the script menu. Copy the first code on a new script section above "main". After this, follow [url=https://www.pokecommunity.com/showthread.php?t=309204&highlight=happiness]this thread[/url]. But, instead of 'pbBalancedLevel($Trainer.party)', use 'highestLevelInParty'.
    
    I aren't sure if this code is still working, since it is an old code.
     
    4
    Posts
    4
    Years
    • Seen Apr 23, 2020
    Ya I made the mistake of not removing ($Trainer.party) when adding the code. Thank you sooo much for taking the time out of your day to help me. I have been working on this problem for like 3 weeks now.
     
    Back
    Top