• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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
    9
    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
     
    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
     
    thank you but were exactly is this
     
    i understand line 1059 but what part of code what are i mean thx u in advance by the way big help
     
    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.
     
    thank u it has worked and is back to normal
     
    Back
    Top