Telemetius
Tele*
- 256
- Posts
- 10
- Years
- Italy
- Seen Jan 9, 2022
Hey there. First time posting here.
I got the same error when I ran the EBS, and diving into the code for the "PokeBattle_Battle" section shows that the V16 update changes the parameters of the "pbRecallAndReplace" function on line 1465.
Code:Old V15 Code: def pbRecallAndReplace(index,newpoke,batonpass=false) @battlers[index].pbResetForm if !@battlers[index].isFainted? @scene.pbRecall(index) end pbMessagesOnReplace(index,newpoke) pbReplace(index,newpoke,batonpass) return pbOnActiveOne(@battlers[index]) end New V16 Code: pbRecallAndReplace(index,newpoke,newpokename=-1,batonpass=false,moldbreaker=false) @battlers[index].pbResetForm if !@battlers[index].isFainted? @scene.pbRecall(index) end pbMessagesOnReplace(index,newpoke,newpokename) pbReplace(index,newpoke,batonpass) return pbOnActiveOne(@battlers[index],false,moldbreaker) end
Now it has five parameters rather than three, and the names have been changed slightly, so the error is caused by the EBS calling the old number of parameters with the old names. Because Essentials V16 isn't using the old parameters, it can't retrieve information about the next Pokemon being sent out, causing an endless loop. This is the code used by the EBS in the section "#1 Battle" around line 260:
Code:alias pbRecallAndReplace_old pbRecallAndReplace def pbRecallAndReplace(index,newpoke,batonpass=false) @replaced=true return pbRecallAndReplace_old(index,newpoke,batonpass) end
Luckily there is a quick solution to this that fixes the loop and lets you complete a battle against a trainer. In the "#1 Battle" code section, go to line 248 ("alias pbReplace_old pbReplace") and delete all the code down to line 264 (just before "alias pbRun_old pbRun"). Then copy the code below and paste it on line 248:
Code:alias pbReplace_old pbReplace def pbReplace(index,newpoke,newpokename=-1,batonpass=false,moldbreaker=false) if !@replaced @battlers[index].pbResetForm if !@battlers[index].isFainted? @scene.pbRecall(index) end end pbReplace_old(index,newpoke,batonpass) @replaced=false end alias pbRecallAndReplace_old pbRecallAndReplace def pbRecallAndReplace(index,newpoke,newpokename=-1,batonpass=false,moldbreaker=false) @replaced=true return pbRecallAndReplace_old(index,newpoke,newpokename,batonpass,moldbreaker) end
This lets the EBS use the new parameters so that it can retrieve information about the Pokemon during battle. This is only a temporary fix to help allow you to test your game in V16 using the EBS system, until Luka S.J. officially updates EBS for V16, in which case you should use the updated code. Hope you understood all of this and it fixes the issue for others too!
O.o Well it does! I haven't completely tested it but for now every battle shows absolutely no errors :D