# Dialogues

> **Info:**
The dialogue is saved in the NPC's own file in the npcs folder.

## How It Works

A dialogue is a set of steps. Each step has lines of text and a list of choices, and each choice can run [actions](../plugin-information/action-types.md) and open another step. A dialogue does nothing on its own: open it with a `[DIALOGUE]` action, in the NPC's [click actions](../main-features/click-actions.md) or [proximity actions](../main-features/proximity-actions.md).

<figure><img src="../.gitbook/assets/dialogue/dialogue.png" alt="" width="563"><figcaption><p>Edit NPC (Dialogue)</p></figcaption></figure>

The NPC's display name is the title, and [placeholders](../plugin-information/placeholders.md) work in the text and the choices.

## How It Is Shown

On servers with Paper's dialog screens, the step opens as a dialog with one button per choice and a close button. Everywhere else it is sent in chat, with the choices as lines to click. A chat choice can be clicked once, by the player it was sent to, within 10 minutes.

Bedrock players always get a Bedrock form with the same buttons when Floodgate or Geyser is installed on the server, for steps with and without choices. Closing the form ends the dialogue.

Dialog screens can be turned off for chat everywhere with [Dialogue Use Dialogs](../configurations/main-configuration.md#dialogue-use-dialogs).

## Steps

The Dialogue screen of the NPC's editor lists every step, as many as you like. A new step gets an id such as `step_1`. The first step in the list is the start step, the one `[DIALOGUE]` opens without a step id. Turn on Reordering on the bottom bar, click a step and then another to swap them; moving a step to the front makes it the start step. Preview opens the dialogue for you as players see it, and returns you to the editor when it ends. Settings holds the typing speed and the camera lock.

<figure><img src="../.gitbook/assets/dialogue/steps.png" alt="" width="563"><figcaption><p>Dialogue (welcome)</p></figcaption></figure>

## Text

The lines shown in the step, one after the other.

<figure><img src="../.gitbook/assets/dialogue/text.png" alt="" width="563"><figcaption><p>welcome (Text)</p></figcaption></figure>

## Buttons

The buttons of the step, as many as you like, over as many pages as needed: Add Button adds one, Left-Click edits it and Right-Click removes it. A step without buttons only has the close button. The step's Text and Preview are on the bottom bar; Text opens the list of lines the NPC says in that step.

<figure><img src="../.gitbook/assets/dialogue/buttons.png" alt="" width="563"><figcaption><p>welcome (Button 1)</p></figcaption></figure>

## Button Text

The text of the button.

<figure><img src="../.gitbook/assets/dialogue/button-text.png" alt="" width="563"><figcaption><p>Button 1 (Button Text)</p></figcaption></figure>

## Next Step

The step that opens after the choice's actions have run. Leave it empty to end the dialogue there.

<figure><img src="../.gitbook/assets/dialogue/next-step.png" alt="" width="563"><figcaption><p>Button 1 (Next Step)</p></figcaption></figure>

## Button Actions

The actions run when the choice is picked, before the next step opens. When a `[PERMISSION]` or `[CONDITION]` action stops them, the next step does not open.

<figure><img src="../.gitbook/assets/dialogue/button-actions.png" alt="" width="563"><figcaption><p>Button 1 (Button Actions)</p></figcaption></figure>

## Typing Speed

How many letters of the text appear each tick, from 1 to 20. 0 shows the text at once. In chat the text is drawn again as it types, so older chat lines scroll away; in a dialog screen the player gets a Skip button. Clicking the NPC skips to the full text. Bedrock forms always show the full text.

<figure><img src="../.gitbook/assets/dialogue/typing-speed.png" alt="" width="563"><figcaption><p>Settings (Typing Speed)</p></figcaption></figure>

## Camera Lock

Keeps the player looking at the NPC while the dialogue is open. It lets go when the dialogue ends, the player sneaks, walks more than 12 blocks away, changes world or leaves. In chat, a step without choices ends 3 seconds after its text is shown.

<figure><img src="../.gitbook/assets/dialogue/camera-lock.png" alt="" width="563"><figcaption><p>Settings (Camera Lock)</p></figcaption></figure>

Source: https://www.phoenixplugins.com/docs/phoenix-npcs/features/dialogues