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

Two undefined method errors

  • 87
    Posts
    9
    Years
    Hey,

    I'm having two errors in my script in my game, and its unknown to me on how to fix it.

    1.Method Error?
    Code:
    Exception: NoMethodError
    Message: undefined method `pbTooHigh?' for 1:Fixnum
    PokeBattle_Battle:4049:in `__clauses__pbEndOfRoundPhase'
    PokeBattle_Battle:4047:in `each'
    PokeBattle_Battle:4047:in `__clauses__pbEndOfRoundPhase'
    PokeBattle_Battle:3998:in `each'
    PokeBattle_Battle:3998:in `__clauses__pbEndOfRoundPhase'
    PokeBattle_Clauses:42:in `pbEndOfRoundPhase'
    PokeBattle_Battle:2791:in `pbStartBattleCore'
    PokeBattle_Battle:2790:in `logonerr'
    PokeBattle_Battle:2790:in `pbStartBattleCore'
    PokeBattle_Battle:2774:in `loop'
    2. Berry Error: There's an error that is produced when a trainer has a Pokemon with a berry like the Chilean Berry or the Passho Berry that reduces the effects of a super-effective move.
    Code:
    Exception: NoMethodError
    Message: undefined method `[]=' for nil:NilClass
    PokeBattle_Move:1331:in `pbCalcDamage'
    PokeBattle_Move:1452:in `pbEffect'
    PokeBattle_MoveEffects:5614:in `pbEffect'
    PokeBattle_Battler:3128:in `pbProcessMoveAgainstTarget'
    PokeBattle_Battler:3086:in `each'
    PokeBattle_Battler:3086:in `pbProcessMoveAgainstTarget'
    PokeBattle_Battler:3499:in `pbUseMove'
    PokeBattle_Battler:3473:in `loop'
    PokeBattle_Battler:3502:in `pbUseMove'
    PokeBattle_Battler:3705:in `pbProcessTurn'
    I know it means that nothing is in place for it, but how do I fix it?
    Thanks in Advance!
     
    Last edited:
    Can you post the code that's giving you errors?
    This for the the 1st one....
    Code:
    # Moody
          if i.hasWorkingAbility(:MOODY)
            PBDebug.log("[#{i.pbThis}'s Moody triggered]")
            randomup=[]; randomdown=[]
            for i in [PBStats::ATTACK,PBStats::DEFENSE,PBStats::SPEED,PBStats::SPATK,
                      PBStats::SPDEF,PBStats::ACCURACY,PBStats::EVASION]
              randomup.push(i) if !i.pbTooHigh?(i)
              randomdown.push(i) if !i.pbTooLow?(i)

    The Second One....
    Well this is complicated because it has nothing, but this:
    Code:
     finaldamagemult=pbModifyDamage(finaldamagemult,attacker,opponent)
        damage=(damage*finaldamagemult*1.0/0x1000).round
        opponent.damagestate.calcdamage=damage
        PBDebug.log("   Move's damage calculated to be #{damage}")
        return damage
     
    For the first one, the error is in something before the code that's making i a numeric value rather than a battler object. I would suggest making sure there are enough end statements to close off all nested for loops.

    For the second, the error is probably a type mismatch. Check through all your berry scripts and compare them to the original scripts.
     
    For the first one, the error is in something before the code that's making i a numeric value rather than a battler object. I would suggest making sure there are enough end statements to close off all nested for loops.

    For the second, the error is probably a type mismatch. Check through all your berry scripts and compare them to the original scripts.

    For the first one, I put in as many end statements for the amount of ifs ,and it comes up to a syntax error on line 4149.
     
    It's not just the ifs that need end statements. For loops need them as well.
     
    Back
    Top