• 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!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Uproar Error

  • 13
    Posts
    5
    Years
    • Seen Jun 22, 2022
    As far as I'm aware, I haven't made any script changes to Uproar, but it's showing an error every time I use the move and I'm not sure how to resolve it. The game doesn't crash, so it's not a critical problem, but I would like to figure out what's wrong and fix it.

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

    Exception: NameError

    Message: undefined local variable or method `attacker' for #<PokeBattle_Move_0D1:0xe9f58b0>

    PokeBattle_Move:210:in `isContactMove?'

    PokeBattle_Battler:1273:in `pbEffectsOnDealingDamage'

    PokeBattle_Battler:2796:in `pbProcessMoveAgainstTarget'

    PokeBattle_Battler:2717:in `each'

    PokeBattle_Battler:2717:in `pbProcessMoveAgainstTarget'

    PokeBattle_Battler:3212:in `pbUseMove'

    PokeBattle_Battler:3192:in `loop'

    PokeBattle_Battler:3215:in `pbUseMove'

    PokeBattle_Battler:3413:in `pbProcessTurn'

    PokeBattle_Battler:3412:in `logonerr'
     
    Can we see the code for uproar in your project, because isContactMove? isn't defined in that class, and in the super class, it takes no arguments, and checks the flags from the PBS.
    alternatively, just replace it with a clean version.
    Code:
    ################################################################################
    # User must use this move for 2 more rounds. No battlers can sleep. (Uproar)
    ################################################################################
    class PokeBattle_Move_0D1 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        ret=super(attacker,opponent,hitnum,alltargets,showanimation)
        if opponent.damagestate.calcdamage>0
          if attacker.effects[PBEffects::Uproar]==0
            attacker.effects[PBEffects::Uproar]=3
            @battle.pbDisplay(_INTL("{1} caused an uproar!",attacker.pbThis))
            attacker.currentMove=@id
          end
        end
        return ret
      end
    end
    If it happens for moves other than Uproar, you may have touched that super class method, defined in Pokebattle_Move, and inherited by all the move effect classes. The same idea for the fix in that case, replace with clean.
     
    You must be right about it being an issue with contact moves and not Uproar itself because my script is identical.
    Here's my script for contact. I changed it to allow Long Reach to bypass contact, but I might have made a mistake.

    def isContactMove?
    return false if (attacker && attacker.hasWorkingAbility(:LONGREACH))
    return (@flags&0x01)!=0 # flag a: Makes contact
    end
     
    Back
    Top