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

Battle error

Venomous_Zero86

Pokemon Chosen Ones (Coming Soon)
120
Posts
8
Years
    • Seen Feb 11, 2022
    ---------------------------
    Pokemon Chosen Ones
    ---------------------------
    Exception: NameError

    Message: undefined local variable or method `abil' for #<PokeBattle_Battler:0x7ce59e0>

    PokeBattle_Battler:1059:in `pbAbilitiesOnSwitchIn'

    PokeBattle_Battle:2124:in `pbOnActiveAll'

    PokeBattle_Battle:2123:in `each'

    PokeBattle_Battle:2123:in `pbOnActiveAll'

    PokeBattle_Battle:2570:in `pbStartBattleCore'

    PokeBattle_Battle:2395:in `pbStartBattle'

    PTrainer_NPCTrainers:345:in `pbTrainerBattle'

    PTrainer_NPCTrainers:344:in `pbSceneStandby'

    PTrainer_NPCTrainers:346:in `pbTrainerBattle'

    PTrainer_NPCTrainers:343:in `pbBattleAnimation'



    This exception was logged in

    C:\Users\Mike\Saved Games/Pokemon Chosen Ones/errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------

    this happens in test battles and in any battles i do how do i fix this
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    This isn't a clean copy of Essentials v16.2
    Line 1059 in there is if choices.length>0
    Just above it is a variable abil though, so double check this whole section here. (Coincidentally, the only instance of abil is there)
    Code:
    # Trace
        if self.hasWorkingAbility(:TRACE)
          choices=[]
          for i in 0...4
            [email protected][i]
            if pbIsOpposing?(i) && !foe.isFainted?
              abil=foe.ability
              if abil>0 &&
                 !isConst?(abil,PBAbilities,:TRACE) &&
                 !isConst?(abil,PBAbilities,:MULTITYPE) &&
                 !isConst?(abil,PBAbilities,:ILLUSION) &&
                 !isConst?(abil,PBAbilities,:FLOWERGIFT) &&
                 !isConst?(abil,PBAbilities,:IMPOSTER) &&
                 !isConst?(abil,PBAbilities,:STANCECHANGE)
                choices.push(i)
              end
            end
          end
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    Go to your line 1059, and make sure that the code in that area is the same as the one I posted earlier, assuming that this is a modified v16.2.
     

    Venomous_Zero86

    Pokemon Chosen Ones (Coming Soon)
    120
    Posts
    8
    Years
    • Seen Feb 11, 2022
    i understand line 1059 but what part of code what are i mean thx u in advance by the way big help
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    Sorry, Perhaps it would help if we could see what you are looking at
    Open your script editor, go to Section PokeBattle_Battler, on line 1059, and either take a picture of the surrounding code or paste a copy here (In
    Code:
     tags please).
    
    But to reiterate, make sure the code near that line is similar to the one I posted.
     
    Back
    Top