# Dialogue

Class in [Yarn](/api/csharp/yarn.md)

Inherits from `System.Object`

## Summary

Co-ordinates the execution of Yarn programs.

```csharp
public class Dialogue : ISmartVariableEvaluator
```

## Constructors

| Name                                                                                     | Description                                                                            |
| ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [Dialogue(Yarn.IVariableStorage)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue..ctor.md) | Initializes a new instance of the [Dialogue](/api/csharp/yarn/yarn.dialogue.md) class. |

## Fields

| Name                                                                                         | Description                              |
| -------------------------------------------------------------------------------------------- | ---------------------------------------- |
| [DefaultStartNodeName](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.defaultstartnodename.md) | The node that execution will start from. |

## Methods

| Name                                                                                                                     | Description                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Continue()](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.continue.md)                                                   | Starts, or continues, execution of the current Program.                                                                                                                  |
| [GetHeaders(string)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.getheaders.md)                                         | Gets the collection of headers present on the node named `nodeName` .                                                                                                    |
| [GetHeaderValue(string,string)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.getheadervalue.md)                          | Gets the value of the header named `headerName` on the node named `nodeName` , or `null` if the header can't be found.                                                   |
| [GetSaliencyOptionsForNodeGroup(string)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.getsaliencyoptionsfornodegroup.md) | Queries the [Dialogue](/api/csharp/yarn/yarn.dialogue.md) for what content could possibly run if the node group nodeGroup was run.                                       |
| [GetStringIDForNode(string)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.getstringidfornode.md)                         | Returns the string ID that contains the original, uncompiled source text for a node.                                                                                     |
| [GetTagsForNode(string)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.gettagsfornode.md)                                 | Returns the tags for the node `nodeName` .                                                                                                                               |
| [HasSalientContent(string)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.hassalientcontent.md)                           | Returns if the node group has any potential nodes to be run based on the current salient selector.                                                                       |
| [IsNodeGroup(string)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.isnodegroup.md)                                       | Gets a value indicating whether `nodeName` is the name of a valid node group in the program.                                                                             |
| [NodeExists(string)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.nodeexists.md)                                         | Gets a value indicating whether a specified node exists in the Program.                                                                                                  |
| [SetNode(string)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.setnode.md)                                               | Prepares the [Dialogue](/api/csharp/yarn/yarn.dialogue.md) that the user intends to start running a node.                                                                |
| [SetProgram(Program)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.setprogram.md)                                        | Loads all nodes from the provided [Program](/api/csharp/yarn/yarn.program.md) .                                                                                          |
| [SetSelectedOption(int)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.setselectedoption.md)                              | Signals to the [Dialogue](/api/csharp/yarn/yarn.dialogue.md) that the user has selected a specified [Option](/api/csharp/yarn/yarn.optionset/yarn.optionset.option.md) . |
| [Stop()](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.stop.md)                                                           | Immediately stops the [Dialogue](/api/csharp/yarn/yarn.dialogue.md) .                                                                                                    |
| [TryGetSmartVariable(string,T)](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.trygetsmartvariable.md)                     | Evaluate the value of a smart variable named `name` .                                                                                                                    |
| [UnloadAll()](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.unloadall.md)                                                 | Unloads all nodes from the Dialogue.                                                                                                                                     |

## Properties

| Name                                                                                               | Description                                                                                                                                                                           |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CommandHandler](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.commandhandler.md)                   | Gets or sets the [CommandHandler](/api/csharp/yarn/yarn.commandhandler.md) that is called when a command is to be delivered to the game.                                              |
| [ContentSaliencyStrategy](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.contentsaliencystrategy.md) | Gets or sets the content saliency strategy used by this [Dialogue](/api/csharp/yarn/yarn.dialogue.md) .                                                                               |
| [CurrentNode](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.currentnode.md)                         | Gets the name of the node that this Dialogue is currently executing.                                                                                                                  |
| [DialogueCompleteHandler](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.dialoguecompletehandler.md) | Gets or sets the [DialogueCompleteHandler](/api/csharp/yarn/yarn.dialoguecompletehandler.md) that is called when the dialogue reaches its end.                                        |
| [IsActive](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.isactive.md)                               | Gets a value indicating whether the Dialogue is currently executing Yarn instructions.                                                                                                |
| [Library](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.library.md)                                 | Gets the [Library](/api/csharp/yarn/yarn.library.md) that this Dialogue uses to locate functions.                                                                                     |
| [LineHandler](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.linehandler.md)                         | Gets or sets the [LineHandler](/api/csharp/yarn/yarn.linehandler.md) that is called when a line is ready to be shown to the user.                                                     |
| [LogDebugMessage](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.logdebugmessage.md)                 | Invoked when the Dialogue needs to report debugging information.                                                                                                                      |
| [LogErrorMessage](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.logerrormessage.md)                 | Invoked when the Dialogue needs to report an error.                                                                                                                                   |
| [NodeCompleteHandler](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.nodecompletehandler.md)         | Gets or sets the [NodeCompleteHandler](/api/csharp/yarn/yarn.nodecompletehandler.md) that is called when a node is complete.                                                          |
| [NodeNames](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.nodenames.md)                             | Gets the names of the nodes in the currently loaded Program.                                                                                                                          |
| [NodeStartHandler](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.nodestarthandler.md)               | Gets or sets the [NodeStartHandler](/api/csharp/yarn/yarn.nodestarthandler.md) that is called when a node is started.                                                                 |
| [OptionsHandler](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.optionshandler.md)                   | Gets or sets the [OptionsHandler](/api/csharp/yarn/yarn.optionshandler.md) that is called when a set of options are ready to be shown to the user.                                    |
| [PrepareForLinesHandler](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.prepareforlineshandler.md)   | Gets or sets the [PrepareForLinesHandler](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.prepareforlineshandler.md) that is called when the dialogue anticipates delivering some lines. |
| [VariableStorage](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.variablestorage.md)                 | Gets or sets the object that provides access to storing and retrieving the values of variables.                                                                                       |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/api/csharp/yarn/yarn.dialogue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
