This doesn't affect battle UI at all, so it should. This plugin should be set to load after any of those add-ons though, since it does alias a few methods that UI plugins might theoretically need to edit for some reason.
After a raid style capture the bug happens but the game doesn't crash. By the way, when my Pokémon use multi-strike moves to knock foe down, capture comes earlier than effects and hit times, at least when I use Surging Strike.
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.6]
Exception: NoMethodError
Message: undefined method `legacy_data' for nil:NilClass
The idea was that once the battle cap has been reached, the variable goes from 0 to 1
This way it triggers the second handler "TargetHPHalf_foe_repeat" that has the condition "ignoreUntil" => "Variable_1".
If this one triggers, then it substract the variable value and make it 0 again so that, if the foe reach half it's HP again( healing then again under 50%), it should not activate again, since the Variable is now 0.
But it doesn't work this way, it activates everytime after it have been trigered once.
Does the "IgnoreUntil" statement check only once if it's true and the the ignore until is always ignored ?
The idea was that once the battle cap has been reached, the variable goes from 0 to 1
This way it triggers the second handler "TargetHPHalf_foe_repeat" that has the condition "ignoreUntil" => "Variable_1".
If this one triggers, then it substract the variable value and make it 0 again so that, if the foe reach half it's HP again( healing then again under 50%), it should not activate again, since the Variable is now 0.
But it doesn't work this way, it activates everytime after it have been trigered once.
Does the "IgnoreUntil" statement check only once if it's true and the the ignore until is always ignored ?
Yeah, it only triggers once. Every single unique trigger that activates during battle is stored in one giant array. The "ignoreUntil" command essentially just means "dont run this command until the specific key you entered is detected in the array." Once it is, the conditions for that "ignoreUntil" are considered to have been met for the rest of the battle.
Disclaimer: Yes I'm working in v20 but I think this error may apply to the v21 version of this plugin as well.
Please correct me if I'm wrong since I've only recently started getting into debugging code.
So I was working on a deluxe battle scenario with the raidcapture feature.
Things are going great. The add 1 hp is working, etc etc
Then things go wrong when the script tries to call the pbraidcapture.
I run into this error:
(Below is the Essentials Deluxe v20.1 version)
Code:
=================
[2024-01-19 02:44:36 -0800]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]
Exception: NoMethodError
Message: undefined method `[]' for true:TrueClass
Backtrace:
[Essentials Deluxe] Midbattle_Triggers.rb:335:in `pbFaint'
Battler_UseMove:698:in `block in pbProcessMoveHit'
Battler_UseMove:698:in `each'
Battler_UseMove:698:in `pbProcessMoveHit'
Battler_UseMove:407:in `block in pbUseMove'
Battler_UseMove:405:in `times'
Battler_UseMove:405:in `pbUseMove'
Battler_UseMove:52:in `block in pbProcessTurn'
PBDebug:6:in `logonerr'
Battler_UseMove:51:in `pbProcessTurn'
BTW, I checked and the issue is the first line of the backtrace. It's possible to get completely different lines after the first line depending on what move you used to knock out the raid Pokemon, but the [Essentials Deluxe] Midbattle_Triggers.rb:335:in `pbFaint' appears every time.
(Below is the Deluxe Battle Kit v21 version of the error):
Code:
=================
[2024-01-19 02:48:10 -0800]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]
Exception: NameError
Message: undefined local variable or method `raid' for #<Battle::Battler>
Backtrace:
[Essentials Deluxe] Midbattle_Triggers.rb:335:in `pbFaint'
Battler_UseMove:698:in `block in pbProcessMoveHit'
Battler_UseMove:698:in `each'
Battler_UseMove:698:in `pbProcessMoveHit'
Battler_UseMove:407:in `block in pbUseMove'
Battler_UseMove:405:in `times'
Battler_UseMove:405:in `pbUseMove'
Battler_UseMove:52:in `block in pbProcessTurn'
PBDebug:6:in `logonerr'
Battler_UseMove:51:in `pbProcessTurn'
So after rigorous testing to identify just what exactly the issue was, I finally arrived at my destination.
Line 335 in midbattle_triggers, which is pbRaidStyleCapture(self, (params[2] || 0), params[0], params[1]) in v20 and pbRaidStyleCapture(self, raid[:capture_chance], raid[:flee_msg], raid[:capture_bgm]) in v21 is likely the issue, because when I change this line to pbRaidStyleCapture(self, 0, nil, nil) in v20 and pbRaidStyleCapture(self, nil, nil, nil)* in v21 respectively the raid capture feature then works as intended.
Please let me know if I made a mistake somewhere.
*Since I am working in v20 I didn't actually test the v21 version but I did notice when comparing the scripts that "chance" has been changed from 0 to nil so I assume the same change would apply here.
Disclaimer: Yes I'm working in v20 but I think this error may apply to the v21 version of this plugin as well.
Please correct me if I'm wrong since I've only recently started getting into debugging code.
So I was working on a deluxe battle scenario with the raidcapture feature.
Things are going great. The add 1 hp is working, etc etc
Then things go wrong when the script tries to call the pbraidcapture.
I run into this error:
(Below is the Essentials Deluxe v20.1 version)
Code:
=================
[2024-01-19 02:44:36 -0800]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]
Exception: NoMethodError
Message: undefined method `[]' for true:TrueClass
Backtrace:
[Essentials Deluxe] Midbattle_Triggers.rb:335:in `pbFaint'
Battler_UseMove:698:in `block in pbProcessMoveHit'
Battler_UseMove:698:in `each'
Battler_UseMove:698:in `pbProcessMoveHit'
Battler_UseMove:407:in `block in pbUseMove'
Battler_UseMove:405:in `times'
Battler_UseMove:405:in `pbUseMove'
Battler_UseMove:52:in `block in pbProcessTurn'
PBDebug:6:in `logonerr'
Battler_UseMove:51:in `pbProcessTurn'
BTW, I checked and the issue is the first line of the backtrace. It's possible to get completely different lines after the first line depending on what move you used to knock out the raid Pokemon, but the [Essentials Deluxe] Midbattle_Triggers.rb:335:in `pbFaint' appears every time.
(Below is the Deluxe Battle Kit v21 version of the error):
Code:
=================
[2024-01-19 02:48:10 -0800]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]
Exception: NameError
Message: undefined local variable or method `raid' for #<Battle::Battler>
Backtrace:
[Essentials Deluxe] Midbattle_Triggers.rb:335:in `pbFaint'
Battler_UseMove:698:in `block in pbProcessMoveHit'
Battler_UseMove:698:in `each'
Battler_UseMove:698:in `pbProcessMoveHit'
Battler_UseMove:407:in `block in pbUseMove'
Battler_UseMove:405:in `times'
Battler_UseMove:405:in `pbUseMove'
Battler_UseMove:52:in `block in pbProcessTurn'
PBDebug:6:in `logonerr'
Battler_UseMove:51:in `pbProcessTurn'
So after rigorous testing to identify just what exactly the issue was, I finally arrived at my destination.
Line 335 in midbattle_triggers, which is pbRaidStyleCapture(self, (params[2] || 0), params[0], params[1]) in v20 and pbRaidStyleCapture(self, raid[:capture_chance], raid[:flee_msg], raid[:capture_bgm]) in v21 is likely the issue, because when I change this line to pbRaidStyleCapture(self, 0, nil, nil) in v20 and pbRaidStyleCapture(self, nil, nil, nil)* in v21 respectively the raid capture feature then works as intended.
Please let me know if I made a mistake somewhere.
*Since I am working in v20 I didn't actually test the v21 version but I did notice when comparing the scripts that "chance" has been changed from 0 to nil so I assume the same change would apply here.
I think you just pasted the same error message twice by accident. I don't see a v21 error message.
Also, I'm a bit confused as to when this error is actually happening. It can't just be any time the raid capture script is called, because it's literally never happened to me before. So it has to be some specific circumstances.
Edit: Oh wait, no, they aren't the same error messages. But they're both in v20? I don't understand.
Edit 2: OHHH I think I understand. Did you just literally copy the v21 code and put it in v20? Well yeah, that's obviously not gonna work, the code is implemented differently.
Looking over the first error, it seems like the issue is just that you set the parameters for the raid capture rule to "true", when it's supposed to be an array containing data for capture chance, flee message, and BGM (if any). Even if you don't want to edit any of these features, it should still be set as an empty array. It should never just be "true."
During the process of working on adding new moves such as Nerve Numb, an Electric-type version of Venom Drench that needs the opponent Pokemon to be paralyzed, I stumbled into a problem with the ability Forewarn. I just found this problem, but I will share the crash log I just got. Even after doing a small tweak to [005] Updated Effects, changing power = m.baseDamage to power = m.power, because the compiler log recommends to stop using the deprecated baseDamage variable, I still get this error message, when a Pokemon with the Forewarn ability hits the field:
Forwarn Crash Log:
# This was the compiler log before I applied the recommended fix
WARNING: Usage of deprecated method "baseDamage" or its alias.
The method is slated to be removed in Essentials v22.
Use "power" instead.
Exception `NoMethodError' at [Deluxe Battle Kit] [005] Updated Effects.rb:158 - undefined method `function' for #<Battle::Move::None>
# This is after
Exception `NoMethodError' at [Deluxe Battle Kit] [005] Updated Effects.rb:159 - undefined method `function' for #<Battle::Move::LowerTargetDefense1>
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.6]
Exception: NoMethodError
Message: undefined method `function' for #<Battle::Move::LowerTargetDefense1>
Backtrace:
[Deluxe Battle Kit] [005] Updated Effects.rb:159:in `block (3 levels) in <main>'
Battle_Battler:564:in `block in eachMoveWithIndex'
Battle_Battler:564:in `each'
Battle_Battler:564:in `each_with_index'
Battle_Battler:564:in `eachMoveWithIndex'
[Deluxe Battle Kit] [005] Updated Effects.rb:155:in `block (2 levels) in <main>'
[Deluxe Battle Kit] [005] Updated Effects.rb:154:in `each'
[Deluxe Battle Kit] [005] Updated Effects.rb:154:in `block in <main>'
Event_Handlers:195:in `trigger'
[Generation 9 Pack] [000] Ability Handlers.rb:21:in `triggerOnSwitchIn'
It's midnight as I write this, so I am sorry if I am not giving enough information to communicate the problem. I need to go to sleep.
During the process of working on adding new moves such as Nerve Numb, an Electric-type version of Venom Drench that needs the opponent Pokemon to be paralyzed, I stumbled into a problem with the ability Forewarn. I just found this problem, but I will share the crash log I just got. Even after doing a small tweak to [005] Updated Effects, changing power = m.baseDamage to power = m.power, because the compiler log recommends to stop using the deprecated baseDamage variable, I still get this error message, when a Pokemon with the Forewarn ability hits the field:
Forwarn Crash Log:
# This was the compiler log before I applied the recommended fix
WARNING: Usage of deprecated method "baseDamage" or its alias.
The method is slated to be removed in Essentials v22.
Use "power" instead.
Exception `NoMethodError' at [Deluxe Battle Kit] [005] Updated Effects.rb:158 - undefined method `function' for #<Battle::Move::None>
# This is after
Exception `NoMethodError' at [Deluxe Battle Kit] [005] Updated Effects.rb:159 - undefined method `function' for #<Battle::Move::LowerTargetDefense1>
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.6]
Exception: NoMethodError
Message: undefined method `function' for #<Battle::Move::LowerTargetDefense1>
Backtrace:
[Deluxe Battle Kit] [005] Updated Effects.rb:159:in `block (3 levels) in <main>'
Battle_Battler:564:in `block in eachMoveWithIndex'
Battle_Battler:564:in `each'
Battle_Battler:564:in `each_with_index'
Battle_Battler:564:in `eachMoveWithIndex'
[Deluxe Battle Kit] [005] Updated Effects.rb:155:in `block (2 levels) in <main>'
[Deluxe Battle Kit] [005] Updated Effects.rb:154:in `each'
[Deluxe Battle Kit] [005] Updated Effects.rb:154:in `block in <main>'
Event_Handlers:195:in `trigger'
[Generation 9 Pack] [000] Ability Handlers.rb:21:in `triggerOnSwitchIn'
It's midnight as I write this, so I am sorry if I am not giving enough information to communicate the problem. I need to go to sleep.
Looking over the first error, it seems like the issue is just that you set the parameters for the raid capture rule to "true", when it's supposed to be an array containing data for capture chance, flee message, and BGM (if any). Even if you don't want to edit any of these features, it should still be set as an empty array. It should never just be "true."
Ah there we go. I used to rely on the information in your Pokecommunity post but you recently cleared that so I had to guess how to use :raidcapture. Thanks for the help!
This section is for the discussion of the tutorials and resources on Eevee Expo. To find tutorials and resources, check out the Tutorial and Resource Manager for optimal navigation.