• 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] New ability causing an error

32
Posts
4
Years
    • Seen Apr 17, 2020
    Hi there, I created a new ability which acts kinda like storm drain but for steel moves and when hit by one, instead of getting the SPATK, raised, the ATK is raised. I simulated a battle but when I get hit I get this error

    ---------------------------
    Pokemon Neutron
    ---------------------------
    [Pokémon Essentials version 17.2]

    Exception: NameError

    Message: uninitialized constant PBStats::ATK

    PokeBattle_Move:312:in `pbTypeImmunityByAbility'

    PokeBattle_Move:445:in `pbTypeModMessages'

    PokeBattle_Move:1050:in `pbCalcDamage'

    PokeBattle_Move:1281:in `pbEffect'

    PokeBattle_MoveEffects:1835:in `pbEffect'

    PokeBattle_Battler:3280:in `pbProcessMoveAgainstTarget'

    PokeBattle_Battler:3236:in `each'

    PokeBattle_Battler:3236:in `pbProcessMoveAgainstTarget'

    PokeBattle_Battler:3719:in `pbUseMove'

    PokeBattle_Battler:3699:in `loop'



    This exception was logged in

    C:\Users\lenovo\Saved Games\Pokemon Neutron\errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
    It is because in the script I have modified this :
    if opponent.pbCanIncreaseStatStage?(PBStats::SPATK,opponent)
    opponent.pbIncreaseStatWithCause(PBStats::SPATK,1,opponent,PBAbilities.getName(opponent.ability))
    into this :
    if opponent.pbCanIncreaseStatStage?(PBStats::ATK,opponent)
    opponent.pbIncreaseStatWithCause(PBStats::ATK,1,opponent,PBAbilities.getName(opponent.ability))
     
    1,682
    Posts
    8
    Years
    • Seen today
    Your issue is because the constant name for the attack stat is ATTACK, not ATK.
    All of the proper names are in script section PBStats.
     
    Back
    Top