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

Level check event

18
Posts
9
Years
    • Seen Jun 22, 2015
    I am trying to create an event that uses a conditional branch to check if the highest level Pokemon in your party is under or over 20. Unfortunately I can not get it to work. I am new to making events and can't figure out what is wrong.

    Here is a screenshot of what I currently have:
    SFmGfZl.png


    How can i make this event work?

    Thanks in Advance!
     
    119
    Posts
    10
    Years
    • Seen Sep 1, 2023
    This can easily be done by adding a small script part into an event which checks the entire party;
    Code:
    for i in 0...$Trainer.party.length
    if $Trainer.party[i].level > XX
    $game_switches[YY] = true
    end
    end
    In the event first set the switch you use to false (as a fail save to make sure it's turned off), then place the above code in a 'custom script' part and replace YY with the switch's number and XX with the desired level. Then add a conditional branch checking whether the switch is checked.

    I don't know about any function called pbMaxLevel(), yet my guess is the above doens't work because @party1 isn't defined. To get the first Pokémon in the player's party use "$Trainer.party[0]", and to get the entire party use "$Trainer.party" (I don't know what kind of variable the function needs, my guess is the entire party one)
     
    Back
    Top