I've encountered a problem with mold breaker and it only occurs when I have the plugins installed
I know it says something about mold breaker being incompatible with some scripts, but I don't believe I've touched or installed anything else related to battling and the disclaimer doesn't provide and specifics, and I haven't been able to find any solutions to this issue.
Weirdly the backtrace has changed since I removed and readded all my plugins.
First Error:
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.5]
Exception: SystemStackError
Message: stack level too deep
Backtrace:
Validation:18:in `block (2 levels) in validate'
Validation:18:in `any?'
Validation:18:in `block in validate'
Validation:16:in `each'
Validation:16:in `map'
Validation:16:in `validate'
GameData:111:in `try_get'
Battle_Battler:73:in `ability'
[Generation 9 Pack] [002] Battle_Battler.rb:269:in `abilityActive?'
Battle_Battler:353:in `hasActiveAbility?'
Any help would be greatly appreciated
Edit: I just did some testing, it didn't occur when my Pokemon had mold breaker or when the opposing side used something other than scale shot, I tested it with dragon claw and fury swipes. I'm starting to think it might have something to do with how the function code of scale shot checks for abilities or I could just be completely wrong.
Edit 2: Tested it by removing the RaiseUserSpd1LowerUserDef1 of the function code and it didn't crash when scale shot was used, I added it back and it crashed again. I've tested recreating the stat changes and it either doesn't change the stats or the trainer refuses to use the move even on a super-effective hit and when it does the stats still don't change.
Final Edit: I finally fixed the issue with Scale Shot. I looked in the Move Functions script and found that the function code for Scale Shot was the same as the normal HitTwoToFiveTimes, which is most likely the problem. I removed the alias and added the stat changes to the function code (didn't know this was how function codes work) and ended up with this:
class Battle::Move::HitTwoToFiveTimesRaiseUserSpd1LowerUserDef1 < Battle::Move
def initialize(battle, move)
super
@statUp = [:SPEED, 1]
@statDown = [:DEFENSE, 1]
end
def pbNumHits(user, targets)
return 4 + rand(2) if user.hasActiveItem?(:LOADEDDICE)
return paldea_pbNumHits(user, targets)
end
end