📒
Deluxe Battle Kit Tutorial
  • Deluxe Battle Kit for v21.1
    • Deluxe Animations
      • Animation: Databoxes
      • Animation: Item Usage
      • Animation: Fleeing Pokemon
      • Animation: Mega Evolution
      • Animation: Primal Reversion
      • Animation: Shadow Pokemon
    • Deluxe Battle Rules
      • Rules: Battle Modes
      • Rules: Battle Visuals
      • Rules: Battle Audio
      • Rules: Editing the Player
      • Rules: Mega Evolution
      • Rules: Capturing Pokemon
      • Rules: Editing Wild Pokemon
    • Wild Boss Attributes
      • Attribute: Boosted HP
      • Attribute: Immunities
    • Mid-Battle Scripting
      • Trigger Keys
        • Triggers: Round Phases
        • Triggers: Battler Turns
        • Triggers: Item Usage
        • Triggers: Wild Capture
        • Triggers: Switching
        • Triggers: Megas & Primals
        • Triggers: Move Usage
        • Triggers: Damage Results
        • Triggers: Battler Condition
        • Triggers: End of Effects
        • Triggers: End of Battle
        • Triggers: Variable
        • Triggers: Choices
        • Triggers: Extensions
          • Extensions: User
          • Extensions: Frequency
      • Command Keys
        • Commands: Text & Speech
        • Commands: Audio & Animation
        • Commands: Utilities
        • Commands: Battle Mechanics
        • Commands: Battler Attributes
        • Commands: Battlefield Conditions
        • Commands: Extensions
      • Advanced Scripting
        • Advanced: Speech Utilities
          • Speech: General
          • Speech: Choices
          • Speech: Speakers
        • Advanced: Variable Utilities
        • Advanced: Storing Scripts
        • Advanced: Hardcoding
        • Advanced: Global Scripts
    • Example Battles
      • Examples: Wild Battles
      • Examples: Trainer Battles
    • Miscellaneous Utilities
    • Add-On Tutorials
      • Enhanced Battle UI
        • UI: Battler Info
        • UI: Poke Ball Shortcut
        • UI: Move Info
      • SOS Battles
        • SOS: Plugin Overview
        • SOS: PBS Data
        • SOS: Battle Rules
        • SOS: Mid-Battle Scripting
      • Raid Battles
      • Z-Power
        • Z-Power: Z-Moves
        • Z-Power: Ultra Burst
        • Z-Power: Animations
        • Z-Power: Battle Rules
        • Z-Power: Mid-Battle Scripting
      • Dynamax
        • Dynamax: Properties
        • Dynamax: Move Data
        • Dynamax: Form Data
        • Dynamax: Animations
        • Dynamax: Battle Rules
        • Dynamax: Mid-Battle Scripting
      • Terastallization
        • Terastal: Tera Types
        • Terastal: Tera Forms
        • Terastal: Animations
        • Terastal: Battle Rules
        • Terastal: Mid-Battle Scripting
      • Improved Item AI
        • Item AI: Handlers
      • Wonder Launcher
        • Launcher: Plugin Overview
        • Launcher: PBS Data
        • Launcher: Battle Rules
        • Launcher: Mid-Battle Scripting
      • Animated Pokemon System
        • Animated: Pokemon Sprites
        • Animated: Dynamic Sprite Effects
        • Animated: UI Sprites
        • Animated: Sprite Editor
        • Animated: Mid-Battle Scripting
      • Animated Trainer Intros
        • Intros: Trainer Sprites
        • Intros: Sprite Editor
        • Intros: UI Sprites
        • Intros: Battle Transitions
        • Intos: Mid-Battle Scripting
Powered by GitBook
On this page

Was this helpful?

  1. Deluxe Battle Kit for v21.1
  2. Mid-Battle Scripting
  3. Command Keys

Commands: Extensions

Section 4.B.7

You cannot have more than one key in a single hash with the same name. If you do, the last instance of that key will overwrite all of the others, effectively making the duplicate keys meaningless. Because of this, you cannot have duplicate Command Keys in a single hash at the same time. This poses a problem, however, if you wish to use the effects of a Command Key multiple times in a single hash to do different things.

For example, say you want to use the "UserDealtCriticalHit_player" Trigger Key so that some text is displayed when the player's Pokemon scores a critical hit in battle.

"UserDealtCriticalHit_player" => {
  "speech" => [:Opposing, "No fair! Lucky hit...", "C'mon, {1}!"],
  "text"   => [:Opposing, "{1} is raring to go!"]
}

In this example, the opponent will comment on the player's lucky hit. But what if you wanted the player to respond to this with their own line of dialogue? Using the "speech" Command Key is no longer possible, since it has already been used once, right? Well normally, yes. However, you can bypass this limitation by using Command Key extensions.

This is very simple, and much more straightforward than Trigger Key extensions. For Command Keys, all you need to do is include an underscore and then add any other character you want to the key to make it unique. For simplicity's sake, I tend to just use letters in alphabetical order to keep things neat and tidy. However, you can use whatever you want, in reality. Letters, numbers, symbols, or entire words - pretty much anything that can be used in a string can be used here, just as long as it appears after an underscore.

"UserDealtCriticalHit_player" => {
  "speech_A" => [:Opposing, "No fair! Lucky hit...", "C'mon, {1}!"],
  "text"     => [:Opposing, "{1} is raring to go!"],
  "speech_B" => "Hmph, looks like they aren't giving up so easily!"
}

Building off of the previous example, we now added dialogue for the player in response to the opponent's text. Because "speech_A" and "speech_B" are different names, the key limitation is bypassed, allowing you to use as many of the same Command Keys as you'd like in a single hash.

Here's a much more elaborate example, building off of the previous example even further:

"UserDealtCriticalHit_player" => {
    "speech_A"       => [:Opposing, "No fair! Lucky hit...", "C'mon, {1}!"],
    "text_A"         => [:Opposing, "{1} is raring to go!"],
    "speech_B"       => "Hmph, looks like they aren't giving up so easily!",
    "setBattler_A"   => 1,
    "battlerStats_A" => [:ATTACK, 1, :SPEED, 1],
    "speech_C"       => "Hah! Looks like my {1} will stop at nothing to win!",
    "setBattler_B"   => 0,
    "speech_D"       => "Two can play at that game! Let's go, {1}!",
    "battlerStats_B" => [:SPECIAL_ATTACK, 1, :SPEED, 1]
  }
PreviousCommands: Battlefield ConditionsNextAdvanced Scripting

Last updated 10 months ago

Was this helpful?