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

[Error] self-fulfilling IF conditions?

6
Posts
5
Years
    • Seen Sep 12, 2020
    I'm using 16.x (I don't know if 17.x has an elite battle system equivalent, if it does please tell me so I can switch)
    I do not know why or how, but some IF lines in my essentials are making the conditions true before checking said contidions. and it even modifies pokemon.PBS when I run the game.

    for example:
    if pokemon.ballused = 26
    makes the pokemon's ballused value 26 and then checks if the value is 26.

    and also
    if opponent.hasWorkingAbility(:STURDY)
    replaces the pokemon in question's ability for sturdy before checking, modifying the pokemon.PBS

    this wrecked my PBS file and I had to remake it, please halp u.u
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    One = means "set the variable on the left to the value of what's on the right". Two == is what you use to compare two values.

    Your examples really shouldn't have altered anything in the PBS files. How were you using this code to make that happen?
     
    Last edited:
    6
    Posts
    5
    Years
    • Seen Sep 12, 2020
    oh... I'm more of a noob than I thought XD thanks!
    and my PBS tends to replace abilities for sturdy and some others, testing does have the ability to alter the PBS. it even turns off "read only" on the PBS files and displays a warning message.
     
    Back
    Top