• 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!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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] Wild Encounter Undefined Method '>'

I get this error when I try to fight in a wild encounter.
It says I have no moves left, and attempts to use Struggle, but then this happens:
Code:
---------------------------
Pokémon Universal
---------------------------
[Pokémon Essentials version 17.2]

Exception: NoMethodError

Message: undefined method `>' for false:FalseClass

PokeBattle_Battler:3486:in `pbSuccessCheck'

PokeBattle_Battler:3890:in `pbProcessMoveAgainstTarget'

PokeBattle_Battler:3866:in `each'

PokeBattle_Battler:3866:in `pbProcessMoveAgainstTarget'

PokeBattle_Battler:4419:in `pbUseMove'

PokeBattle_Battler:4366:in `loop'

PokeBattle_Battler:4422:in `pbUseMove'
I don't want to start from scratch, as I had just implemented all of the Gen 6-8 stuff.
Thanks in advance.
 
Now give us a print about this line:
Code:
PokeBattle_Battler:3486:in `pbSuccessCheck'

Because around there the game doesn't know what's '>'.
 
Now give us a print about this line:
Code:
PokeBattle_Battler:3486:in `pbSuccessCheck'
Because around there the game doesn't know what's '>'.

Here's a screen of my game at Line 3486 in PokeBattle_Battler:
[PokeCommunity.com] Wild Encounter Undefined Method '>'

And here's the code on the screen:
Code:
     return false
    end
    if thismove.function==0x113 && user.effects[PBEffects::Stockpile]==0 # Spit Up
      @battle.pbDisplay(_INTL("But it failed to spit up a thing!"))
      PBDebug.log("[Move failed] #{user.pbThis}'s Spit Up did nothing as Stockpile's count is 0")
      return false
    end
    if target.effects[PBEffects::Protect] && thismove.canProtectAgainst? &&
       !target.effects[PBEffects::ProtectNegation]
      @battle.pbDisplay(_INTL("{1} protected itself!",target.pbThis))
      @battle.successStates[user.index].protected=true
      PBDebug.log("[Move failed] #{target.pbThis}'s Protect stopped the attack")
      return false
    end
    p=thismove.priority
    p+=3 if user.hasWorkingAbility(:TRIAGE) && thismove.pbIsHealingMove?
    if USENEWBATTLEMECHANICS
      p+=1 if user.hasWorkingAbility(:PRANKSTER) && thismove.pbIsStatus?
      p+=1 if user.hasWorkingAbility(:GALEWINGS) && isConst?(thismove.type,PBTypes,:FLYING)
    end
    if target.pbOwnSide.effects[PBEffects::QuickGuard] && thismove.canProtectAgainst? &&
       p>0 && !target.effects[PBEffects::ProtectNegation]
      @battle.pbDisplay(_INTL("{1} was protected by Quick Guard!",target.pbThis))
      PBDebug.log("[Move failed] The opposing side's Quick Guard stopped the attack")
      return false
    end
    if @battle.field.effects[PBEffects::PsychicTerrain]>0 && p>0 && !target.isAirborne?
      @battle.pbDisplay(_INTL("The Psychic Terrain protected {1}!",target.pbThis))
      PBDebug.log("[Move failed] Psychic Terrain stopped the attack")
      return false
    end
    if target.hasWorkingAbility(:QUEENLYMAJESTY) && p>0
      @battle.pbDisplay(_INTL("{1}'s Queenly Majesty made the move ineffective!",target.pbThis))
      PBDebug.log("[Move failed] The target's Queenly Majesty stopped the attack")
      return false
    end
    if target.pbOwnSide.effects[PBEffects::WideGuard] &&
       PBTargets.hasMultipleTargets?(thismove) && !thismove.pbIsStatus? &&
       !target.effects[PBEffects::ProtectNegation]
      @battle.pbDisplay(_INTL("{1} was protected by Wide Guard!",target.pbThis))
      PBDebug.log("[Move failed] The opposing side's Wide Guard stopped the attack")
      return false
    end
    if target.pbOwnSide.effects[PBEffects::CraftyShield] && thismove.pbIsStatus? &&
       thismove.function!=0xE5 # Perish Song
 
Last edited:
The error is saying that "@battle.field.effects[PBEffects::PsychicTerrain]" is false. Did you initialize "@battle.field.effects[PBEffects::PsychicTerrain]" to "false" instead of "0"?
It's intitalized in PokeBattle_ActiveSideField as:
Code:
@effects[PBEffects::PsychicTerrain]  = 0
I couldn't find any instances of
Code:
@battle.field.effects[PBEffects::PsychicTerrain]
in an initializing context.
 
Now, did you install script for Psychic Terrain?

The error is saying that "@battle.field.effects[PBEffects::PsychicTerrain]" is false. Did you initialize "@battle.field.effects[PBEffects::PsychicTerrain]" to "false" instead of "0"?

Can anyone still help me?
 
Back
Top