• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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.

[Scripting Question] Baton Pass Error with Illusion

  • 37
    Posts
    7
    Years
    Before I thought it was something related to the move in specific, but later I identified that the error is only if it is replaced by some pokémon with the Illusion ability.
    Code:
    [Pokémon Essentials version 17.1]
    Exception: NoMethodError
    Message: undefined method `pbGetLastPokeInTeam' for #<PokeBattle_Battler:0xd04bc78>
    PokeBattle_Battler:5410:in `pbUseMove'
    PokeBattle_Battler:5550:in `pbProcessTurn'
    PokeBattle_Battler:5549:in `logonerr'
    PokeBattle_Battler:5549:in `pbProcessTurn'
    PokeBattle_Battle:3614:in `pbAttackPhase'
    PokeBattle_Battle:3611:in `each'
    PokeBattle_Battle:3611:in `pbAttackPhase'
    PokeBattle_Battle:3599:in `times'
    PokeBattle_Battle:3599:in `pbAttackPhase'
    PokeBattle_Battle:3193:in `pbStartBattleCore'

    The move works normally if the substitute does not have this ability (illusion), so I discarded the possibility of being something related to it.
    Anyone can help about that bug?
     
    After looking at the code I'd say this error will also appear on U-Turn, Volt Switch, Eject Button and Roar, Whirlwind, Circle Throw, Dragon Tail, Red Card, when switching into a Pokemon with Illusion.

    Could you please:
    1) check if the error appears in the stated cases as well
    2) enabled the debug log, recreate the error and add the debug log here. That way we can see what exactly was going on
     
    I found a solution, this line:
    Code:
    if isConst?(@battle.pbParty(user.index)[newpoke].ability,PBAbilities,:ILLUSION)
              [email protected](user.index)
            end
    It is necessary change "=pbGetLastPokeInTeam(user.index)" to "[email protected](user.index)"

    Works perfectly for me. Ty for your help ^^

    Other question: how I enable the debug log?
     
    Last edited:
    Thanks for sharing your solution with the community 😁

    The debug log can be enabled via Debug Menu. There is an option called "Toggle Battle Log"
    I
     
    Back
    Top