- 1,541
- Posts
- 11
- Years
- Seen today
I've got an error when I tried to make a Pokemon faint when I used a Raid Capture rule. Here:
Code:[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' [ZUD Mechanics] Battler_Overrides.rb:155:in `pbFaint' [Generation 9 Pack] Battler.rb:518:in `block in pbProcessMoveHit' [Generation 9 Pack] Battler.rb:518:in `each' [Generation 9 Pack] Battler.rb:518:in `pbProcessMoveHit' [Generation 9 Pack] Ability Shield Changes.rb:728:in `block in pbUseMove' [Generation 9 Pack] Ability Shield Changes.rb:726:in `times' [Generation 9 Pack] Ability Shield Changes.rb:726:in `pbUseMove' [ZUD Mechanics] Battler_Overrides.rb:101:in `pbUseMove' 166:Battler_UseMove:52:in `block in pbProcessTurn'
Oh, that's because I updated how this battle setting works and completely forgot to make note of it in the last update. This setting is no longer set to "true" to be set, you instead set it as an array containing up to three items. The first item is a string that contains any custom "flee" text you want to display if you fail to capture the Pokemon. The second item may be the name of a BGM track that should play during the capture sequence, like how normal raid battle switch to a different music track while capturing raid Pokemon. And the third item may be a number between 1-100 to set the odds of capturing the Pokemon, which overrides the normal capture rate (just like how raid Pokemon have different forced capture rates than normal Pokemon, regardless of ball type).
The second and third items are completely optional, and can be omitted if you want. And the first setting can just be set to "nil" if you don't want any custom flee text. So if you don't want to customize this setting at all, you can simple set it equal to
[nil]
.Here's the updated entry I just added to the tutorial:
:raidcapture => Array
Only relevant to wild battles. When set, this battle will have Raid-style capture mechanics. This means that when you KO the wild Pokemon, it will not faint. Instead, you will be prompted to capture it while its in a weakened state. If you fail to capture it, or choose not to, the wild Pokemon will flee to end the battle. You can combine this rule with :setcapture to ensure that any ball you throw at the Pokemon is guaranteed to capture it, and/or the :nocapture rule to prevent the player from throwing any Poke Balls during this battle except when prompted to. Note that wild double/triple battles can also have Raid-style capture mechanics. If so, you will be prompted to capture each wild Pokemon you defeat, allowing you to capture multiple Pokemon in a single battle.
The array you set this to can contain up to three items, although only one item is required. The first item in this array may be a string, and whatever text you enter will be used for the message that appears if the Pokemon flees. You may use {1} to refer to the wild Pokemon's name in this text. If you instead set this string to "nil", the generic flee text will display instead.
The second item in this array may be another string, this time the name of an audio file found in the BGM folder. If the file exists, this track will play when the Pokemon is weakened and becomes capturable, similar to how a "capture" theme plays when attempting to capture a raid Pokemon in the main series. If you omit this item, or set it to "nil", then the music will not change and the default battle music will continue to play instead.
The last item in this array may be a number between 1-100. This number will override the normal capture chance of whatever Poke Ball you throw at the Pokemon. For example, if you set this number to 20, then whatever ball is thrown will have a 20% chance at successfully capturing the Pokemon, and an 80% chance to fail, regardless of the ball type (except for Master Balls, which will always succeed and ignore this setting). Note that these forced odds will override the :setcapture setting, so there's no need to set that battle rule if you intend to set forced capture odds here. If you omit this item in the array or set it to 0, then the normal capture chance will be used instead.