> For the complete documentation index, see [llms.txt](https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/deluxe-battle-kit-for-v21.1/mid-battle-scripting/command-keys/commands-audio-and-animation.md).

# Commands: Audio & Animation

These are keys which trigger sound effects, music files, or animations to play.

<details>

<summary><mark style="background-color:blue;"><strong>"playSE"</strong></mark> => <mark style="background-color:yellow;">String</mark></summary>

Plays a sound effect. Set as a string containing the file name of the desired sound effect found in the `Audio/SE` folder.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"playCry"</strong></mark> => <mark style="background-color:yellow;">Integer or Symbol</mark></summary>

Plays the cry of a Pokemon. You can set this as an integer to play the cry of the Pokemon found at a specific battler index. For example, setting this to 1 would play the cry of the opponent's Pokemon at index 1. If you don't want to set specific battler indexes, you can also use the following symbols to more generally set which battler's cry should play: `:Self`, `:Ally`, `:Ally2`, `:Opposing`, `:OpposingAlly`, `:OpposingAlly2`.\
\
Alternatively, you can instead set this to a species ID to play the cry of any species you want, even if that species isn't currently participating in battle.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"changeBGM"</strong></mark> => <mark style="background-color:yellow;">String or Array</mark></summary>

Changes the current BGM being played to a different track of your choosing. You can set this to a string containing the file name of that music track located in the `Audio/BGM` folder. Alternatively, if you set this as an array, you can customize how this track will play. This array should contain the following data, in this order:

* <mark style="background-color:yellow;">BGM file name</mark> (String)
* <mark style="background-color:yellow;">Fade time</mark> (Integer). This will determine how long the current BGM will take to fade out (in seconds) before the new one begins playing.
* <mark style="background-color:yellow;">Volume</mark> (Integer or nil). This will determine the volume level of the new BGM. You can omit this or set this to nil for the default volume.
* <mark style="background-color:yellow;">Pitch</mark> (Integer or nil). This will determine the pitch level of the new BGM. You can omit this or set this to nil for the default pitch.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"endBGM"</strong></mark> => <mark style="background-color:yellow;">Float</mark> </summary>

Fades out and ends the current BGM being played. This must be set to a float number, which just means any number with a decimal place. This number determines how long (in seconds) the currently playing music will fade out before it completely ends. For example, setting this to `1.5` will have the current music fade out for one and a half seconds before it ends. If you want the current music to end immediately without fading, you would just set this to `0.0`.

Once the music ends, the battle will continue in complete silence. There may be times where you may want this to happen, for some reason. However, if you want to restore music to the battle, you may use <mark style="background-color:blue;">**"resumeBGM"**</mark> to restore the previous BGM, or <mark style="background-color:blue;">**"changeBGM"**</mark> to begin playing a brand new track.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"pauseAndPlayBGM"</strong></mark><strong> => </strong><mark style="background-color:yellow;"><strong>String</strong></mark></summary>

Pauses the current battle music and remembers its position before playing a new BGM. You can set this to a string containing the file name of that music track located in the `Audio/BGM` folder to start playing that BGM.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"resumeBGM"</strong></mark><strong> => </strong><mark style="background-color:yellow;"><strong>Boolean</strong></mark></summary>

Ends the current BGM, and resumes playing a previously paused BGM from its saved position. This won't do anything if there isn't any music track that has been previously paused with <mark style="background-color:blue;">"pauseAndPlayBGM"</mark>.

</details>

<details>

<summary><mark style="background-color:blue;"><strong>"playAnim"</strong></mark> => <mark style="background-color:yellow;">String, Symbol, or Array</mark></summary>

This can be used to make a certain animation play. If this is set to a String, this will attempt to play a common animation by that name (for example "StatUp" will play the stat increase animation). If this is set to a move ID Symbol, this will attempt to play the animation of that move. The targets for these animations will automatically be decided based on which Pokemon triggered the specific Trigger Key this command is located in. If you'd wish to manually set who the user and/or target of this animation should be, you may do so by setting this as an array which contains the following data in this order:

* <mark style="background-color:yellow;">Animation ID</mark> (String or Symbol)
* <mark style="background-color:yellow;">User ID</mark> (Integer or Symbol). This is the battler index of the user of the animation. If there is no user for this animation (something that happens independently of any particular battler, like Trick Room or weather), then a user isn't required. If you don't want to set specific battler indexes, you can also use the following symbols to more generally set which battler should be the user of the animation: `:Self`, `:Ally`, `:Ally2`, `:Opposing`, `:OpposingAlly`, `:OpposingAlly2`.
* <mark style="background-color:yellow;">Target ID</mark> (Integer or Symbol). This is the battler index of the target of the animation. If there is no target for this animation (an animation that only affects the user, or happens independently of any particular battler), then a target isn't required. If you don't want to set specific battler indexes, you can also used the same symbols listed in the User ID section above to more generally set which battler should be the target of the animation.

</details>
