- 57
- Posts
- 5
- Years
- Seen Apr 17, 2022
Hey, I have been having problems installing the 6-8 gen Abilities, but I have already managed to fix many errors. But there is one that I don't understand. Is this:
Does anyone know why it occurs?
Here I leave the part of the code that is indicated in the error.
PokeBattle_Battler
PokeBattle_Battle
PokeBattle_Clauses
PokeBattle_Battle
Spoiler:
[Pokémon Essentials version 17.2]
Exception: NoMethodError
Message: undefined method `>' for nil:NilClass
PokeBattle_Battler:2703:in `pbSuccessCheck'
PokeBattle_Battler:3085:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:3081:in `each'
PokeBattle_Battler:3081:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:3625:in `pbUseMove'
PokeBattle_Battler:3605:in `loop'
PokeBattle_Battler:3628:in `pbUseMove'
PokeBattle_Battler:3828:in `pbProcessTurn'
PokeBattle_Battler:3827:in `logonerr'
PokeBattle_Battler:3827:in `pbProcessTurn'
[Pokémon Essentials version 17.2]
Exception: NoMethodError
Message: undefined method `>' for nil:NilClass
PokeBattle_Battle:3638:in `__clauses__pbEndOfRoundPhase'
PokeBattle_Battle:3637:in `each'
PokeBattle_Battle:3637:in `__clauses__pbEndOfRoundPhase'
PokeBattle_Clauses:42:in `pbEndOfRoundPhase'
PokeBattle_Battle:2599:in `pbStartBattleCore'
PokeBattle_Battle:2598:in `logonerr'
PokeBattle_Battle:2598:in `pbStartBattleCore'
PokeBattle_Battle:2580:in `loop'
PokeBattle_Battle:2603:in `pbStartBattleCore'
PokeBattle_Battle:2401:in `pbStartBattle'
Exception: NoMethodError
Message: undefined method `>' for nil:NilClass
PokeBattle_Battler:2703:in `pbSuccessCheck'
PokeBattle_Battler:3085:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:3081:in `each'
PokeBattle_Battler:3081:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:3625:in `pbUseMove'
PokeBattle_Battler:3605:in `loop'
PokeBattle_Battler:3628:in `pbUseMove'
PokeBattle_Battler:3828:in `pbProcessTurn'
PokeBattle_Battler:3827:in `logonerr'
PokeBattle_Battler:3827:in `pbProcessTurn'
[Pokémon Essentials version 17.2]
Exception: NoMethodError
Message: undefined method `>' for nil:NilClass
PokeBattle_Battle:3638:in `__clauses__pbEndOfRoundPhase'
PokeBattle_Battle:3637:in `each'
PokeBattle_Battle:3637:in `__clauses__pbEndOfRoundPhase'
PokeBattle_Clauses:42:in `pbEndOfRoundPhase'
PokeBattle_Battle:2599:in `pbStartBattleCore'
PokeBattle_Battle:2598:in `logonerr'
PokeBattle_Battle:2598:in `pbStartBattleCore'
PokeBattle_Battle:2580:in `loop'
PokeBattle_Battle:2603:in `pbStartBattleCore'
PokeBattle_Battle:2401:in `pbStartBattle'
Does anyone know why it occurs?
Here I leave the part of the code that is indicated in the error.
Spoiler:
PokeBattle_Battler
Code:
if @battle.field.effects[PBEffects::PsychicTerrain]>0 && p>0 && !target.isAirborne?
@battle.pbDisplay(_INTL("{1} surrounds itself with psychic terrain!",target.pbThis))
PBDebug.log("[Move failed] Psychic Terrain stopped the attack")
return false
end
Code:
def pbProcessMoveAgainstTarget(thismove,user,target,numhits,turneffects,nocheck=false,alltargets=nil,showanimation=true,danced=false)
realnumhits=0
totaldamage=0
destinybond=false
for i in 0...numhits <--------------Line 3081
target.damagestate.reset
# Check success (accuracy/evasion calculation)
if !nocheck &&
!pbSuccessCheck(thismove,user,target,turneffects,i==0 || thismove.successCheckPerHit?)<------------Line 3085
if thismove.function==0xBF && realnumhits>0 # Triple Kick
break # Considered a success if Triple Kick hits at least once
elsif thismove.function==0x10B # Hi Jump Kick, Jump Kick
if !user.hasWorkingAbility(:MAGICGUARD)
PBDebug.log("[Move effect triggered] #{user.pbThis} took crash damage")
# TODO: Not shown if message is "It doesn't affect XXX..."
@battle.pbDisplay(_INTL("{1} kept going and crashed!",user.pbThis))
damage=(user.totalhp/2).floor
if damage>0
@battle.scene.pbDamageAnimation(user,0)
user.pbReduceHP(damage)
end
user.pbFaint if user.isFainted?
end
end
Code:
# For each target in turn
i=0; loop do break if i>=targets.length<------------Line 3605
# Get next target
userandtarget=[user,targets[i]]
success=pbChangeTarget(thismove,userandtarget,targets)
user=userandtarget[0]
target=userandtarget[1]
if i==0 && thismove.target==PBTargets::AllOpposing
# Add target's partner to list of targets
pbAddTarget(targets,target.pbPartner)
end
# If couldn't get the next target
if !success
i+=1
next
end
# Get the number of hits
numhits=thismove.pbNumHits(user)
# Reset damage state, set Focus Band/Focus Sash to available
target.damagestate.reset
# Use move against the current target
pbProcessMoveAgainstTarget(thismove,user,target,numhits,turneffects,false,alltargets,showanimation,danced)<------------Line 3625
showanimation=false
i+=1
end<------------Line 3628
end
Code:
# Use the move
# @battle.pbDisplayPaused("Before: [#{@lastMoveUsedSketch},#{@lastMoveUsed}]")
PBDebug.log("#{pbThis} used #{choice[2].name}")
PBDebug.logonerr{<--------------------------------------------------------Line 3627
pbUseMove(choice,choice[2][email protected])<------------Line 3828
}
# @battle.pbDisplayPaused("After: [#{@lastMoveUsedSketch},#{@lastMoveUsed}]")
return true
end
end
Code:
# Aurora Veil # changed added
for i in 0...2<---------------------------------------------------------Line 3637
if sides[i].effects[PBEffects::AuroraVeil]>0<------------Line 3638
sides[i].effects[PBEffects::AuroraVeil]-=1
if sides[i].effects[PBEffects::AuroraVeil]==0
pbDisplay(_INTL("Your team's Aurora Veil wore off!")) if i==0
pbDisplay(_INTL("The opposing team's Aurora Veil wore off!")) if i==1
PBDebug.log("[End of effect] Aurora Veil ended on the player's side") if i==0
PBDebug.log("[End of effect] Aurora Veil ended on the opponent's side") if i==1
end
end
end
Code:
def pbEndOfRoundPhase()
__clauses__pbEndOfRoundPhase()<------------Line 42
if @rules["suddendeath"] && @decision==0
if pbPokemonCount(@party1)>pbPokemonCount(@party2)
@decision=1 # loss
elsif pbPokemonCount(@party1)<pbPokemonCount(@party2)
@decision=2 # win
end
end
end
end
Code:
pbOnActiveAll # Abilities
@turncount=0
loop do # Now begin the battle loop<------------Line 2580
PBDebug.log("")
PBDebug.log("***Round #{@turncount+1}***")
if @debug && @turncount>=100
@decision=pbDecisionOnTime()
PBDebug.log("")
PBDebug.log("***Undecided after 100 rounds, aborting***")
pbAbort
break
end
PBDebug.logonerr{
pbCommandPhase
}
break if @decision>0
PBDebug.logonerr{
pbAttackPhase
}
break if @decision>0
PBDebug.logonerr{<------------Line 2598
pbEndOfRoundPhase<------------Line 2599
}
break if @decision>0
@turncount+=1
end<------------Line 2603
return pbEndOfBattle(canlose)
end
Code:
def pbStartBattle(canlose=false)
PBDebug.log("")
PBDebug.log("******************************************")
begin
pbStartBattleCore(canlose)<------------Line 2401
rescue BattleAbortedException
@decision=0
@scene.pbEndBattle(@decision)
end
return @decision
end