I'm working on a battle related script and got an error within
So I checked a clean copy of Essentials annd reproduced the error there as well.
The error message (shortened):
The clean code within v18.1 (line 248 corresponds to line 15 here):
I think b.index should be battler.index
At least it works for me.
Ruby:
pbMessageOnRecall
The error message (shortened):
Ruby:
Message: undefined local variable or method `b' for #<PokeBattle_Battle:0x11aced68>
Backtrace: Battle_Action_Switching:248:in `pbMessageOnRecall'
The clean code within v18.1 (line 248 corresponds to line 15 here):
Ruby:
def pbMessageOnRecall(battler)
if battler.pbOwnedByPlayer?
if battler.hp<=battler.totalhp/4
pbDisplayBrief(_INTL("Good job, {1}! Come back!",battler.name))
elsif battler.hp<=battler.totalhp/2
pbDisplayBrief(_INTL("OK, {1}! Come back!",battler.name))
elsif battler.turnCount>=5
pbDisplayBrief(_INTL("{1}, that’s enough! Come back!",battler.name))
elsif battler.turnCount>=2
pbDisplayBrief(_INTL("{1}, come back!",battler.name))
else
pbDisplayBrief(_INTL("{1}, switch out! Come back!",battler.name))
end
else
owner = pbGetOwnerName(b.index)
pbDisplayBrief(_INTL("{1} withdrew {2}!",owner,battler.name))
end
end
I think b.index should be battler.index
At least it works for me.