Hello! When trying to use the plug-in for making mid-battle scripts, I got this error:
[2025-02-16 16:43:15 +0000]
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.9]
Exception: NoMethodError
Message: undefined method `index' for nil:NilClass
Backtrace:
[Deluxe Battle Kit] [002] Midbattle Triggers.rb:65:in `block in <main>'
[Deluxe Battle Kit] [002] Midbattle Triggers.rb:36:in `trigger'
[Deluxe Battle Kit] [000] Midbattle Animations.rb:175:in `pbConvertBattlerIndex'
[Deluxe Battle Kit] [000] Midbattle Animations.rb:296:in `pbShowSpeaker'
[Deluxe Battle Kit] [002] Midbattle Triggers.rb:248:in `block in <main>'
[Deluxe Battle Kit] [002] Midbattle Triggers.rb:36:in `trigger'
[Deluxe Battle Kit] [001] Midbattle Overwrites.rb:198:in `block (3 levels) in pbMidbattleScripting'
[Deluxe Battle Kit] [001] Midbattle Overwrites.rb:196:in `each'
[Deluxe Battle Kit] [001] Midbattle Overwrites.rb:196:in `block (2 levels) in pbMidbattleScripting'
[Deluxe Battle Kit] [001] Midbattle Overwrites.rb:160:in `each_key'
This is an old battle that was working on previous versions of my game, I believe an update of the deluxe battle kit could have broken it? To be honest I'm quite lost I don't know how to deal with this haha
I wanted to report that I got pretty much the same error as this after recently updating to the most current version. The mid-battle script worked fine before the update, but now there's a problem. The issue comes into play when a battle is set to have a message appear every time after a certain move is used, and that specific move knocks out the target. The message usually works fine, it's only when your Pokémon has been knocked out that it creates an issue.
Here's the error message:
Exception: NoMethodError
Message: undefined method `index' for nil:NilClass
Backtrace:
[Deluxe Battle Kit] [002] Midbattle Triggers.rb:65:in `block in <main>'
[Deluxe Battle Kit] [002] Midbattle Triggers.rb:36:in `trigger'
[Deluxe Battle Kit] [000] Midbattle Animations.rb:175:in `pbConvertBattlerIndex'
[Deluxe Battle Kit] [000] Midbattle Animations.rb:296:in `pbShowSpeaker'
[Deluxe Battle Kit] [002] Midbattle Triggers.rb:248:in `block in <main>'
[Deluxe Battle Kit] [002] Midbattle Triggers.rb:36:in `trigger'
[Deluxe Battle Kit] [001] Midbattle Overwrites.rb:198:in `block (3 levels) in pbMidbattleScripting'
[Deluxe Battle Kit] [001] Midbattle Overwrites.rb:196:in `each'
[Deluxe Battle Kit] [001] Midbattle Overwrites.rb:196:in `block (2 levels) in pbMidbattleScripting'
[Deluxe Battle Kit] [001] Midbattle Overwrites.rb:160:in `each_key'
Here's the mid-battle script:
"AfterMove_PLANETARYLASER_repeat" => { "setSpeaker" => :Opposing,
"editWindow" => ["Polaris", "choice 1"],
"speech" => ["Recharging!"]}
And here's line 65, in case you want that again:
default_target = default_battler.pbDirectOpposing(true) if default_target.index == default_battler.index