Commands: Text & Speech

Section 4.B.1

These are keys which trigger text or trainer dialogue to be displayed, or editing the display of trainer sprites or text windows during dialogue.

"text" => String or Array

This is used to display custom battle messages. This can be entered either as a single string, or an array containing multiple strings to display multiple boxes of text. You can use {1} in these strings to refer to the battler name, or {2} to refer to the name of the battler's trainer (if any). If you want to refer to the player's name specifically, you can use \\PN. If set as an array, you may also include battler indexes prior to a string to change the focus of the text. For example, if entered as [0, "{1} wont back down!"], the {1} in the string will refer to the name of the battler at index 0, which would be the player's Pokemon, even if the battler who initially triggered this was the opponent. 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 focus: :Self, :Ally, :Ally2, :Opposing, :OpposingAlly, :OpposingAlly2. You may also include the symbol :Choices in the array to display dialogue choices for the player to select from. However, these choices must first be set up with the "setChoices" key.

"speech" => String or Array

This works identically to how the "text" key works, except this will trigger dialogue animations. This includes cinematic black bars on the top and bottom of the screen, battle UI will be hidden, and a trainer sprite will appear on screen to speak the lines of text (if it's an opposing trainer).

When a speaker is talking, their name will appear above their dialogue boxes. In wild battles, the wild Pokemon will be considered the opposing speaker, so no trainer will slide on screen since the wild battler will already be on screen. Trainers who appear on the player's side will never slide on screen, so you will only ever see dialogue boxes for those trainers, even if they're a partner trainer and not the player.

"setChoices" => Array

This is used to set up branching dialogue choices which can then be used by both the "text" and "speech" keys. This must be set up before the text or speech key in which you want the player to select from these choices. Then, that text or speech key must be set to an array containing a string that asks the player the question, followed by the symbol :Choices. This symbol will indicate that the choices you set up in this key should be displayed. To set up your list of choices with this key, this must be entered as an array that contains the following data in this order:

  • Symbol ID. This can be anything you want, as long as it's a unique symbol. This is meant to identify this specific set of choices. For example, if you have a set of choices asking the player for their favorite color, you might want to name this something like :colors. This ID is important, because this is what the "Choice" Trigger Keys use to determine when to trigger.

  • Answer Index. This stores what the correct answer to this list of choices should be. For example, if you have a set of choices asking the player what color the sky is, and the possible choices are "Red", "Green", "Blue" and "Yellow", then you would set the answer index to 3, since the correct answer is Blue, which is the third choice. If the set of choices doesn't have a correct answer, such as the question "What's your favorite color?", then you just set this answer index to nil.

  • Choices. Finally, the next entries should be the actual choices you want the player to choose between, which can just be entered as strings. For example, if the player is being asked "What's your favorite color?", the choices you set here might look something like: [:colors, nil, "Red", "Green", "Blue", "Yellow"] If you want some sort of response to be displayed upon the player making a selection, then you may set your choices as a hash instead of a series of strings. This will make it so there will be some sort of reaction to the choice the player makes. For example, if the player is being asked "What color is the sky?", the choices you set here might look something like this: [:colors, 3, { "Red" => "Huh? No...maybe during sunset?", "Green" => "I don't think I've ever seen a green sky...", "Blue" => "Ding! Ding! Correct!", "Yellow" => "Huh? No...maybe during a sunrise?" }]

"setSpeaker" => Integer, Symbol, or Array

This is used to manually set a specific speaker to begin speaking. This can be used if you want to swap out the current speaker for another one within one seamless speech event without having to end the animation and restart it again for each different speaker that you want to say a line of dialogue. For example, if you set this to an integer, you can set the index of a specific battler, and the owner of that battler will slide on screen to speak. If the owner is on the player's side (or a wild Pokemon), then any currently active speaker will be hidden, and the dialogue boxes will change to indicate the new speaker. Alternatively, you may also use one of the following symbols if you want to more generally assign an index: :Self, :Ally, :Ally2, :Opposing, :OpposingAlly, :OpposingAlly2. If you want the actual Pokemon to be the speaker (even if it's owned by a trainer and not wild), then you can set this symbol to :Battler, instead. If you want to hide the current speaker sprite altogether, you can set this symbol to :Hide. You can even set up a speaker to slide on screen who isn't even participating in this battle. You may set the symbol ID of any trainer type to have the sprite of that trainer type slide on screen to speak. For example, if you set this to :LEADER_Brock, Brock may slide on screen to speak, even if you aren't even currently battling him. The same can even be done with Pokemon sprites. If you enter a species ID, a sprite of that Pokemon will slide on screen to speak, even if you aren't battling that species. For Pokemon sprites only, you can expand on this even further by setting up an array. If you do, you can set the following data in this array in this order to customize the Pokemon sprite that will appear on screen:

  • Species ID

  • Form number

  • Gender (0 = Male, 1 = Female)

  • Shiny (Boolean)

"editSpeaker" => Integer, Symbol or Array

This accepts all of the same arguments and does all of the same things as "setSpeaker", except this can't be used to slide a new speaker sprite on screen. Instead, all this does is update the current speaker sprite to display a different graphic.

This has a niche use, but is mainly used to update a trainer's sprite while they're talking to display a different "frame", if you have multiple sprites of the same trainer. This can be used to convey emotion while the trainer is speaking certain lines, or to create mini animations by stringing multiple different frames of the same trainer together back to back. You don't have to use it this way, though. You can change the speaker's sprite into an entirely different one, if you'd like.

"editWindow" => String, Array or Symbol

This is used to customize the name plates and dialogue windowskin of the current speaker. Normally when a speaker is talking, the windowskin of their dialogue boxes will match their gender. Male speakers will have a blue windowskin, while female speakers will have a red windowskin, and genderless speakers will use the default windowskin. However, you can edit the windowskin of these dialogue boxes as well as the speaker's name that appears in the name plate with this key.

Setting this to a string will change the speaker's display name that appears in the name plate to the entered string. This can be used if you want to give this speaker a custom name, or if you want to suggest someone else is speaking off screen. If you want to edit the windowskin of the speaker's dialogue boxes, then you must enter this as an array where the first item in the array is the speaker's name (or nil if you want to keep the default name), and the second item in the array can be the name of the specific windowskin file you want to use that is found in the Graphics/Windowskins folder. The color of the dialogue text will change to suit the colors of the windowskin you set here. If you would like to hide all name plates and dialogue boxes entirely, then you can instead set this to the symbol :Hide. This will hide these displays completely, and any text will simply appear over the black bar at the bottom of the screen. If you want to display the default name plate and dialogue boxes for this speaker again, you may set this to the symbol :Show.

"endSpeech" => Boolean

This prematurely ends cinematic speech when set to true. Most of the time, cinematic speech animations will end on their own when appropriate. However, there are niche situations where you might want to end the animation early to do something else without the trainer on screen, such as play a sound effect or animation; in which case you may need to use this key.

Last updated