All pages
Powered by GitBook
Couldn't generate the PDF for 515 pages, generation stopped at 100.
Extend with 50 more pages.
1 of 100

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

NodeStartHandler

Property in

Gets or sets the that is called when a node is started.

TypeMappings

Property in

Gets a dictionary that maps CLR types to their corresponding Yarn types.

Text

Property in

Gets the text of the command.

UnloadAll()

Method in

Unloads all nodes from the Dialogue.

C#

public NodeStartHandler NodeStartHandler
{
            get; set; }

Summary

Dialogue
NodeStartHandler
public static IReadOnlyDictionary<System.Type, Yarn.IType> TypeMappings { get; };

Summary

BuiltinTypes
public string Text { get; private set; }

Summary

Command
public void UnloadAll()

Summary

Dialogue

CommandHandler

Property in Dialogue

Summary

Gets or sets the CommandHandler that is called when a command is to be delivered to the game.

public CommandHandler CommandHandler
{
            get; set; }

CurrentNode

Property in Dialogue

Summary

Gets the name of the node that this Dialogue is currently executing.

public string CurrentNode
{
            get; }

Remarks

If Continue() has never been called, this value will be null .

Name

Property in IType

Summary

Gets the name of this type.

string Name { get; }

IsActive

Property in Dialogue

Summary

Gets a value indicating whether the Dialogue is currently executing Yarn instructions.

public bool IsActive { get };

LogDebugMessage

Property in Dialogue

Summary

Invoked when the Dialogue needs to report debugging information.

public Logger LogDebugMessage { get; set; }

Parent

Property in FunctionType

Summary

Gets the parent of this type.

public IType Parent { get; }

Remarks

All types have Any as their ultimate parent type (except for Any itself.)

String

Property in BuiltinTypes

Summary

Gets the type representing strings.

public static IType String { get; };

ID

Property in Option

Summary

Gets the identifying number for this option.

public int ID { get; private set; }

Remarks

When the user selects this option, this value should be used as the parameter for SetSelectedOption(int) .

SetValue(string,bool)

Method in MemoryVariableStore

Summary

Stores a bool in this VariableStorage.

public void SetValue(string variableName, bool boolValue)

Parameters

Name
Description

string variableName

Continue()

Method in

Starts, or continues, execution of the current Program.

This method repeatedly executes instructions until one of the following conditions is encountered:

  • The or is called. After calling either of these handlers, the Dialogue will wait until is called. Continue may be called from inside the or , or may be called at any future time.

GetStringIDForNode(string)

Method in

Returns the string ID that contains the original, uncompiled source text for a node.

A node's source text will only be present in the string table if its tags header contains rawText.

Because the class is designed to be unaware of the contents of the string table, this method does not test to see if the string table contains an entry with the line ID. You will need to test for that yourself.

Name

AddProgram(Program)

Method in

Loads the nodes from the specified , and adds them to the nodes already loaded.

If Yarn.Dialogue.Program is null , this method has the effect as calling .

Name
Description

IType

Interface in

Defines properties that describe a type in the Yarn language.

Name
Description

NodeExists(string)

Method in

Gets a value indicating whether a specified node exists in the Program.

Name
Description

Instructions

Property in

The list of instructions in this node.

ReturnType

Property in

Gets the type of value that this function returns.

OptionsHandler

Property in

Gets or sets the that is called when a set of options are ready to be shown to the user.

The Options Handler delivers an to the game. Before can be called to resume execution, must be called to indicate which was selected by the user. If is not called, an exception is thrown.

SourceTextStringID

Property in

the entry in the program's string table that contains the original text of this node; null if this is not available

Description

Property in

Gets a more verbose description of this type.

Parameters

Property in

Gets the list of the parameter types that this function is called with.

The length of this list also determines the number of parameters this function accepts (also known as the function's arity ).

DialogueException

Class in

Inherits from System.Exception

An exception that is thrown by when there is an error in executing a .

Command

Struct in

Inherits from System.ValueType

A command, sent from the to the game.

You do not create instances of this struct yourself. They are created by the during program execution.

Name
Description

Description

Property in

Gets a more verbose description of this type.

LineHandler

Property in

Gets or sets the that is called when a line is ready to be shown to the user.

Number

Property in

Gets the type representing numbers.

DestinationNode

Property in

Gets the name of the node that will be run if this option is selected.

The value of this property not be valid if this is a shortcut option.

Parent

Property in

Gets the parent of this type.

All types have as their ultimate parent type (except for itself.)

NodeStartHandler

Delegate in

Inherits from System.MulticastDelegate

Represents the method that is called when the Dialogue begins executing a node.

Name
Description

Clear()

Method in

Removes all variables from storage.

Dialogue(Yarn.IVariableStorage)

Constructor in

Initializes a new instance of the class.

Name
Description

Methods

Property in

Gets the collection of methods that are available on this type.

NodeCompleteHandler

Property in

Gets or sets the that is called when a node is complete.

Tags

Property in

The tags associated with this node.

LanguageCode

Property in

Gets or sets the 's locale, as an IETF BCP 47 code.

This code is used to determine how the plural and ordinal markers determine the plural class of numbers.

For example, the code "en-US" represents the English language as used in the United States.

Logger

Delegate in

Inherits from System.MulticastDelegate

Represents a method that receives diagnostic messages and error information from a .

The text that this delegate receives may be output to a console, or sent to a log.

Name
Description

SetValue(string,float)

Method in

Stores a float in this VariableStorage.

Name
Description

Methods

Property in

Gets the collection of methods that are available on this type.

Stop()

Method in

Immediately stops the .

The will not be called if the dialogue is ended by calling .

DialogueCompleteHandler

Property in

Gets or sets the that is called when the dialogue reaches its end.

Clear()

Method in

Removes all variables from storage.

NodeNames

Property in

Gets the names of the nodes in the currently loaded Program.

SetValue(string,bool)

Method in

Stores a bool in this VariableStorage.

Name
Description

ID

Field in

The string ID for this line.

GetFunction(string)

Method in

Returns a System.Delegate with a given name.

Name
Description

SetValue(string,float)

Method in

Stores a float in this VariableStorage.

Name
Description

Substitutions

Field in

The values that should be inserted into the user-facing text before delivery.

Options

Property in

Gets the s that should be presented to the user.

  • : An option to be presented to the user.

PrepareForLinesHandler

Property in

Gets or sets the that is called when the dialogue anticipates delivering some lines.

ToString()

Method in

ImportLibrary(Library)

Method in

Loads functions from another .

If the other library contains a function with the same name as one in this library, the function in the other library takes precedence.

Name
Description

SetValue(string,string)

Method in

Stores a string in this VariableStorage.

Name
Description

LogErrorMessage

Property in

Invoked when the Dialogue needs to report an error.

FunctionExists(string)

Method in

Gets a value indicating whether this contains a function named name .

Name
Description

Labels

Property in

A jump table, mapping the names of labels to positions in the instructions list.

Any

Property in

Gets the type representing any value.

IsAvailable

Property in

Gets a value indicating whether the player should be permitted to select this option.

If this value is false, this option had a line condition on it that failed. The option will still be delivered to the game, but, depending on the needs of the game, the game may decide to not allow the player to select it, or not offer it to the player at all.

This is intended for situations where games wish to show options that the player _could_ have taken, if some other condition had been met (e.g. having enough "charisma" points).

Line

Property in

Gets the that should be presented to the user for this option.

See the documentation for the class for information on how to prepare a line before presenting it to the user.

The name to associate with this variable.

bool boolValue

The boolean value to store.

Description

string nodeName

The name of the node.

The string ID.

Summary

Remarks

Parameters

Dialogue
Dialogue

Returns

true if a node named nodeName exists in the Program, false otherwise.

string nodeName

The name of the node.

Summary

Parameters

Returns

Dialogue
public pbc::RepeatedField<global::Yarn.Instruction> Instructions {
      get; }

Summary

Node
public IType ReturnType { get; internal set; }

Summary

FunctionType
public OptionsHandler OptionsHandler
{
            get; set; }

Summary

Remarks

Dialogue
OptionsHandler
OptionSet
Continue()
SetSelectedOption(int)
Option
SetSelectedOption(int)
public string SourceTextStringID {
      get; set; }

Summary

Node
public string Description
{
            get; set; }

Summary

FunctionType
public List<IType> Parameters { get; };

Summary

Remarks

FunctionType
public class DialogueException : System.Exception

Summary

Yarn
Dialogue
Program
string Description { get; }

Summary

IType
public LineHandler LineHandler
{
            get; set; }

Summary

Dialogue
LineHandler
public static IType Number { get; };

Summary

BuiltinTypes
public string DestinationNode { get; private set; }

Summary

Remarks

Option
IType Parent { get; }

Summary

Remarks

IType
Any
Any
public void Clear()

Summary

MemoryVariableStore
public Dialogue(Yarn.IVariableStorage variableStorage)

Yarn.IVariableStorage variableStorage

The IVariableStorage that this Dialogue should use.

Summary

Parameters

Dialogue
Dialogue
public MethodCollection Methods { get };

Summary

FunctionType
public NodeCompleteHandler NodeCompleteHandler
{
            get; set; }

Summary

Dialogue
NodeCompleteHandler
public pbc::RepeatedField<string> Tags {
      get; }

Summary

Node
public string LanguageCode { get; set; }

Summary

Remarks

Dialogue
Dialogue

string message

The text that should be logged.

Summary

Remarks

Parameters

Yarn
Dialogue

float floatValue

The number to store.

string variableName

Summary

Parameters

IVariableStorage

The name to associate with this variable.

MethodCollection Methods { get; }

Summary

IType
public void Stop()

Summary

Remarks

Dialogue
Dialogue
DialogueCompleteHandler
Stop()
public DialogueCompleteHandler DialogueCompleteHandler
{
            get; set; }

Summary

Dialogue
DialogueCompleteHandler
void Clear();

Summary

IVariableStorage
public IEnumerable<string> NodeNames
{
            get; }

Summary

Dialogue

bool boolValue

The boolean value to store.

string variableName

Summary

Parameters

IVariableStorage

The name to associate with this variable.

public string ID;

Summary

Line

The System.Delegate .

string name

Summary

Parameters

Library

The name of the function to retrieve.

Returns

float floatValue

The number to store.

string variableName

Summary

Parameters

MemoryVariableStore

The name to associate with this variable.

public string[] Substitutions;

Summary

Line
public Option[] Options { get; private set; }

Summary

See Also

OptionSet
Option
Option
public PrepareForLinesHandler PrepareForLinesHandler
{
            get; set; }

Summary

Dialogue
PrepareForLinesHandler
public override string ToString()

Summary

Node

Yarn.Library otherLibrary

Summary

Remarks

Parameters

Library
Library

The library to import functions from.

string stringValue

The string to store.

string variableName

Summary

Parameters

MemoryVariableStore

The name to associate with this variable.

public Logger LogErrorMessage { get; set; }

Summary

Dialogue

true if a function exists in this Library; false otherwise.

string name

Summary

Parameters

Library
Library

The name of the function to look for.

Returns

public pbc::MapField<string, int> Labels {
      get; }

Summary

Node
public static IType Any { get; };

Summary

BuiltinTypes
public bool IsAvailable { get; private set; }

Summary

Remarks

Option
public Line Line { get; private set; }

Summary

Remarks

Option
Line
Line

Name

Property in Node

Summary

The name of this node.

public string Name {
      get; set; }

DefaultStartNodeName

Field in Dialogue

Summary

The node that execution will start from.

public const string DefaultStartNodeName = "Start";

Library

Property in Dialogue

Summary

Gets the Library that this Dialogue uses to locate functions.

public Library Library { get; internal set; }

Remarks

When the Dialogue is constructed, the Library is initialized with the built-in operators like + , - , and so on.

public string GetStringIDForNode(string nodeName)
public bool NodeExists(string nodeName)
public delegate void Logger(string message);
void SetValue(string variableName, float floatValue);
void SetValue(string variableName, bool boolValue);
public Delegate GetFunction(string name)
public void SetValue(string variableName, float floatValue)
public void ImportLibrary(Library otherLibrary)
public void SetValue(string variableName, string stringValue)
public bool FunctionExists(string name)
The OptionsHandler is called. When this occurs, the Dialogue is waiting for the user to specify which of the options has been selected, and SetSelectedOption(int) must be called before Continue() is called again.)
  • The Program reaches its end. When this occurs, SetNode(string) must be called before Continue() is called again.

  • An error occurs while executing the Program.

  • This method has no effect if it is called while the Dialogue is currently in the process of executing instructions.

    • LineHandler: Represents the method that is called when the Dialogue delivers a Line .

    • OptionsHandler: Represents the method that is called when the Dialogue delivers an OptionSet .

    • CommandHandler: Represents the method that is called when the Dialogue delivers a Command .

    • : Represents the method that is called when the Dialogue reaches the end of a node.

    • : Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

    public void Continue()

    Summary

    Remarks

    Dialogue
    LineHandler
    CommandHandler
    Continue()
    LineHandler
    CommandHandler

    See Also

    program

    The additional program to load.

    public void AddProgram(Program program)

    Summary

    Remarks

    Parameters

    Dialogue
    Program
    SetProgram(Program)

    Gets the collection of methods that are available on this type.

    Gets the name of this type.

    Gets the parent of this type.

    public interface IType

    Description

    Gets a more verbose description of this type.

    Summary

    Properties

    Yarn

    Gets the text of the command.

    • Dialogue.CommandHandler: Gets or sets the CommandHandler that is called when a command is to be delivered to the game.

    public struct Command

    Summary

    Remarks

    Properties

    Yarn
    Dialogue
    Dialogue

    See Also

    The name of the node.

    • LineHandler: Represents the method that is called when the Dialogue delivers a Line .

    • OptionsHandler: Represents the method that is called when the Dialogue delivers an OptionSet .

    • CommandHandler: Represents the method that is called when the Dialogue delivers a Command .

    • : Represents the method that is called when the Dialogue reaches the end of a node.

    • : Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

    public delegate void NodeStartHandler(string startedNodeName);

    Summary

    Parameters

    Yarn

    string startedNodeName

    See Also

    FunctionType

    Class in Yarn

    Inherits from System.Object

    Summary

    A type that represents functions.

    public class FunctionType : IType

    Remarks

    Functions have parameters and a return type, and can be called from script. Instances of this type are created when the host application registers new functions (such as through using the RegisterFunction(string,Delegate) methods or similar.)

    Properties

    Name
    Description

    ParseMarkup(string)

    Method in Dialogue

    Summary

    Parses a line of text, and produces a MarkupParseResult containing the results.

    public MarkupParseResult ParseMarkup(string line)

    Remarks

    The MarkupParseResult 's Text will have any select , plural or ordinal markers replaced with the appropriate text, following this Dialogue 's LanguageCode .

    Parameters

    Name
    Description

    The results of parsing the markup.

    CommandHandler

    Delegate in Yarn

    Inherits from System.MulticastDelegate

    Summary

    Represents the method that is called when the Dialogue delivers a Command .

    public delegate void CommandHandler(Command command);

    Parameters

    Name
    Description
    • : Represents the method that is called when the Dialogue delivers a .

    • : Represents the method that is called when the Dialogue delivers an .

    • : Represents the method that is called when the Dialogue begins executing a node.

    SetSelectedOption(int)

    Method in Dialogue

    Summary

    Signals to the Dialogue that the user has selected a specified Option .

    public void SetSelectedOption(int selectedOptionID)

    Remarks

    After the Dialogue delivers an OptionSet, this method must be called before Continue() is called.

    The ID number that should be passed as the parameter to this method should be the ID field in the Option that represents the user's selection.

    Parameters

    Name
    Description
    • : Represents the method that is called when the Dialogue delivers an .

    • : A set of s, sent from the to the game.

    • : Starts, or continues, execution of the current Program.

    DialogueCompleteHandler

    Delegate in Yarn

    Inherits from System.MulticastDelegate

    Summary

    Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

    public delegate void DialogueCompleteHandler();

    See Also

    • LineHandler: Represents the method that is called when the Dialogue delivers a Line .

    • : Represents the method that is called when the Dialogue delivers an .

    • : Represents the method that is called when the Dialogue delivers a .

    • : Represents the method that is called when the Dialogue begins executing a node.

    • : Represents the method that is called when the Dialogue reaches the end of a node.

    Option

    Struct in OptionSet

    Inherits from System.ValueType

    Summary

    An option to be presented to the user.

    public struct Option

    Properties

    Name
    Description

    ExpandSubstitutions(string,IList<string>)

    Method in Dialogue

    Summary

    Replaces all substitution markers in a text with the given substitution list.

    public static string ExpandSubstitutions(string text, IList<string> substitutions)

    Remarks

    This method replaces substitution markers - for example, {0}

    • with the corresponding entry in substitutions . If text contains a substitution marker whose index is not present in substitutions , it is ignored.

    Parameters

    Name
    Description

    text , with the content from substitutions inserted.

    RegisterFunction(string,Delegate)

    Method in Library

    Summary

    Registers a new function that returns a value, which can be called from a Yarn program.

    public void RegisterFunction(string name, Delegate implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    RegisterFunction(string,Func<T1, T2, T3, T4, T5, TResult>)

    Method in Library

    Summary

    Registers a new function that returns a value, which can be called from a Yarn program.

    public void RegisterFunction<T1, T2, T3, T4, T5, TResult>(string name, Func<T1, T2, T3, T4, T5, TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    TryGetValue(string,T)

    Method in IVariableStorage

    Summary

    Retrieves a value of type T by name.

    bool TryGetValue<T>(string variableName, out T result);

    Parameters

    Name
    Description

    string variableName

    Name
    Description

    true if a value named variableName of type T was retrieved; false otherwise.

    RegisterFunction(string,Func<T1, TResult>)

    Method in Library

    Summary

    Registers a new function that returns a value, which can be called from a Yarn program.

    public void RegisterFunction<T1, TResult>(string name, Func<T1, TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    NodeCompleteHandler

    Delegate in Yarn

    Inherits from System.MulticastDelegate

    Summary

    Represents the method that is called when the Dialogue reaches the end of a node.

    public delegate void NodeCompleteHandler(string completedNodeName);

    Remarks

    This method may be called multiple times over the course of code execution. A node being complete does not necessarily represent the end of the conversation.

    Parameters

    Name
    Description
    • : Represents the method that is called when the Dialogue delivers a .

    • : Represents the method that is called when the Dialogue delivers an .

    • : Represents the method that is called when the Dialogue delivers a .

    OptionSet

    Struct in Yarn

    Inherits from System.ValueType

    Summary

    A set of Option s, sent from the Dialogue to the game.

    public struct OptionSet

    Remarks

    You do not create instances of this struct yourself. They are created by the Dialogue during program execution.

    Properties

    Name
    Description
    Name
    Description
    • : Gets or sets the that is called when a set of options are ready to be shown to the user.

    Yarn Namespace

    Summary

    Contains classes for working with compiled Yarn programs.

    Classes

    Name
    Description

    Contains the built-in types available in the Yarn language.

    Name
    Description
    Name
    Description
    Name
    Description
    Name
    Description

    IVariableStorage

    Interface in Yarn

    Summary

    Provides a mechanism for storing and retrieving instances of the Yarn.Value class.

    public interface IVariableStorage

    Methods

    Name
    Description

    RegisterFunction(string,Func<T1, T2, TResult>)

    Method in Library

    Summary

    Registers a new function that returns a value, which can be called from a Yarn program.

    public void RegisterFunction<T1, T2, TResult>(string name, Func<T1, T2, TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    MemoryVariableStore

    Class in Yarn

    Inherits from System.Object

    Summary

    A simple concrete implementation of IVariableStorage that keeps all variables in memory.

    public class MemoryVariableStore : IVariableStorage

    Methods

    Name
    Description

    LineHandler

    Delegate in Yarn

    Inherits from System.MulticastDelegate

    Summary

    Represents the method that is called when the Dialogue delivers a Line .

    public delegate void LineHandler(Line line);

    Parameters

    Name
    Description
    • : Represents the method that is called when the Dialogue delivers an .

    • : Represents the method that is called when the Dialogue delivers a .

    • : Represents the method that is called when the Dialogue begins executing a node.

    RegisterFunction(string,Func<T1, T2, T3, TResult>)

    Method in Library

    Summary

    Registers a new function that returns a value, which can be called from a Yarn program.

    public void RegisterFunction<T1, T2, T3, TResult>(string name, Func<T1, T2, T3, TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    RegisterFunction(string,Func<TResult>)

    Method in Library

    Summary

    Registers a new function that returns a value, which can be called from a Yarn program.

    public void RegisterFunction<TResult>(string name, Func<TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    RegisterFunction(string,Func<T1, T2, T3, T4, TResult>)

    Method in Library

    Summary

    Registers a new function that returns a value, which can be called from a Yarn program.

    public void RegisterFunction<T1, T2, T3, T4, TResult>(string name, Func<T1, T2, T3, T4, TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    SetProgram(Program)

    Method in Dialogue

    Summary

    Loads all nodes from the provided Program .

    public void SetProgram(Program program)

    Remarks

    This method replaces any existing nodes have been loaded. If you want to load nodes from an additional Program, use the AddProgram(Program) method.

    Parameters

    Name
    Description

    SetNode(string)

    Method in Dialogue

    Summary

    Prepares the Dialogue that the user intends to start running a node.

    public void SetNode(string startNode = DefaultStartNodeName)

    Remarks

    After this method is called, you call Continue() to start executing it.

    If PrepareForLinesHandler has been set, it may be called when this method is invoked, as the Dialogue determines which lines may be delivered during the startNode node's execution.

    Parameters

    Name
    Description

    SetValue(string,string)

    Method in IVariableStorage

    Summary

    Stores a string in this VariableStorage.

    void SetValue(string variableName, string stringValue);

    Parameters

    Name
    Description

    string variableName

    DeregisterFunction(string)

    Method in Library

    Summary

    Removes a function from the Library.

    public void DeregisterFunction(string name)

    Remarks

    If no function with the given name is present in the Library, this method does nothing.

    Parameters

    Name
    Description

    string name

    Line

    Struct in

    Inherits from System.ValueType

    A line of dialogue, sent from the to the game.

    When the game receives a , it should do the following things to prepare the line for presentation to the user.

    1. Use the value in the field to look up the appropriate user-facing text in the string table.

    DestinationNode

    Gets the name of the node that will be run if this option is selected.

    ID

    Gets the identifying number for this option.

    IsAvailable

    Gets a value indicating whether the player should be permitted to select this option.

    Line

    Gets the Line that should be presented to the user for this option.

    Clear()

    Removes all variables from storage.

    SetValue(string,bool)

    Stores a bool in this VariableStorage.

    SetValue(string,float)

    Stores a float in this VariableStorage.

    SetValue(string,string)

    Stores a string in this VariableStorage.

    TryGetValue(string,T)

    Retrieves a value of type T by name.

    Yarn.Program program

    The Program to use.

    string startNode

    The name of the node that will be run. The node have been loaded by calling SetProgram(Program) or AddProgram(Program) .

    The name to associate with this variable.

    string stringValue

    The string to store.

    The name of the function to remove.

    string line

    The line of text to parse.

    Returns

    string text

    The text containing substitution markers.

    System.Collections.Generic.IList<string> substitutions

    The list of substitutions.

    Returns

    System.Delegate implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    Type Parameters

    The name of the variable to retrieve the value of.

    T result

    On return, if this method returned true, contains the retrieved value. If this method returned false, contains the default value of T (for example, 0 for float values, null for strings, and so on.)

    T

    The type of the variable to retrieve.

    Type Parameters

    Returns

    System.Func<TResult> implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    Type Parameters

    NodeCompleteHandler
    DialogueCompleteHandler
    NodeCompleteHandler
    DialogueCompleteHandler
    NodeCompleteHandler: Represents the method that is called when the Dialogue reaches the end of a node.
  • DialogueCompleteHandler: Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

  • Yarn.Command command

    The Command that has been delivered.

    See Also

    LineHandler
    Line
    OptionsHandler
    OptionSet
    NodeStartHandler

    int selectedOptionID

    The ID number of the Option that the user selected.

    See Also

    OptionsHandler
    OptionSet
    OptionSet
    Option
    Dialogue
    Dialogue.Continue()
    OptionsHandler
    OptionSet
    CommandHandler
    Command
    NodeStartHandler
    NodeCompleteHandler

    NodeStartHandler: Represents the method that is called when the Dialogue begins executing a node.

  • DialogueCompleteHandler: Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

  • string completedNodeName

    The name of the node.

    See Also

    LineHandler
    Line
    OptionsHandler
    OptionSet
    CommandHandler
    Command

    Options

    Gets the Option s that should be presented to the user.

    Option

    An option to be presented to the user.

    Structs

    See Also

    Dialogue.OptionsHandler
    OptionsHandler
    NodeCompleteHandler: Represents the method that is called when the Dialogue reaches the end of a node.
  • DialogueCompleteHandler: Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

  • Yarn.Line line

    The Line that has been delivered.

    See Also

    OptionsHandler
    OptionSet
    CommandHandler
    Command
    NodeStartHandler
    Yarn.Program
    Methods
    Name
    Parent
    Text

    Removes all variables from storage.

    SetValue(string,bool)

    Stores a bool in this VariableStorage.

    SetValue(string,float)

    Stores a float in this VariableStorage.

    SetValue(string,string)

    Stores a string in this VariableStorage.

    TryGetValue(string,T)

    Retrieves a value of type T by name.

    Clear()

    The type of the function's first argument.

    T2

    The type of the function's second argument.

    T3

    The type of the function's third argument.

    T4

    The type of the function's fourth argument.

    T5

    The type of the function's fifth argument.

    System.Func<T1, T2, T3, T4, T5, TResult> implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    TResult

    The return type of the function.

    Type Parameters

    T1

    The type of the function's first argument.

    System.Func<T1, TResult> implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    TResult

    The return type of the function.

    Type Parameters

    T1

    The type of the function's first argument.

    T2

    The type of the function's second argument.

    System.Func<T1, T2, TResult> implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    TResult

    The return type of the function.

    Type Parameters

    T1

    The type of the function's first argument.

    T2

    The type of the function's second argument.

    T3

    The type of the function's third argument.

    System.Func<T1, T2, T3, TResult> implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    TResult

    The return type of the function.

    Type Parameters

    T1

    The type of the function's first argument.

    T2

    The type of the function's second argument.

    T3

    The type of the function's third argument.

    T4

    The type of the function's fourth argument.

    System.Func<T1, T2, T3, T4, TResult> implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    TResult

    The return type of the function.

    Type Parameters

    T1

    Boolean

    Property in BuiltinTypes

    Summary

    Gets the type representing boolean values.

    public static IType Boolean { get; };

    Gets the parent of this type.

    Gets the type of value that this function returns.

    Description

    Gets a more verbose description of this type.

    Methods

    Gets the collection of methods that are available on this type.

    Name

    Gets the name of this type.

    Parameters

    Gets the list of the parameter types that this function is called with.

    Represents the method that is called when the Dialogue delivers a .

    Represents a method that receives diagnostic messages and error information from a .

    Represents the method that is called when the Dialogue reaches the end of a node.

    Represents the method that is called when the Dialogue begins executing a node.

    Represents the method that is called when the Dialogue delivers an .

    Represents the method that is called when the dialogue anticipates that it will deliver lines.

    Contains classes for working with Yarn Spinner in the Unity game engine.

    A set of s, sent from the to the game.

    Dialogue

    Co-ordinates the execution of Yarn programs.

    DialogueException

    An exception that is thrown by Dialogue when there is an error in executing a Program .

    FunctionType

    A type that represents functions.

    Library

    A collection of functions that can be called from Yarn programs.

    MemoryVariableStore

    A simple concrete implementation of IVariableStorage that keeps all variables in memory.

    Node

    A node of Yarn script, contained within a Program , and containing Yarn.Instruction s.

    Program

    A compiled Yarn program.

    CommandHandler

    Represents the method that is called when the Dialogue delivers a Command .

    DialogueCompleteHandler

    Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

    IType

    Defines properties that describe a type in the Yarn language.

    IVariableStorage

    Provides a mechanism for storing and retrieving instances of the Yarn.Value class.

    Yarn.Compiler

    Contains classes for compiling Yarn code.

    Yarn.Markup

    Contains classes for working with markup in Yarn lines.

    Command

    A command, sent from the Dialogue to the game.

    Line

    A line of dialogue, sent from the Dialogue to the game.

    Delegates

    Interfaces

    Namespaces

    Structs

    BuiltinTypes

    Use ExpandSubstitutions(string,IList<string>) to replace all substitutions in the user-facing text.

  • Use ParseMarkup(string) to parse all markup in the line.

  • You do not create instances of this struct yourself. They are created by the Dialogue during program execution.

    Name
    Description

    The string ID for this line.

    The values that should be inserted into the user-facing text before delivery.

    • Dialogue.LineHandler: Gets or sets the LineHandler that is called when a line is ready to be shown to the user.

    public struct Line

    Summary

    Remarks

    Yarn
    Dialogue
    Line
    ID

    Fields

    See Also

    Library

    Class in Yarn

    Inherits from System.Object

    Summary

    A collection of functions that can be called from Yarn programs.

    public class Library

    Remarks

    You do not create instances of this class yourself. The Dialogue class creates one of its own, which you can access via the Library property.

    Methods

    Name
    Description
    • : Co-ordinates the execution of Yarn programs.

    Parent
    ReturnType
    LineHandler
    Line
    Logger
    Dialogue
    NodeCompleteHandler
    NodeStartHandler
    OptionsHandler
    OptionSet
    PrepareForLinesHandler
    Yarn.Unity
    OptionSet
    Option
    Dialogue
    ID
    Substitutions

    Removes a function from the Library.

    Gets a value indicating whether this contains a function named name .

    Returns a System.Delegate with a given name.

    Loads functions from another .

    See Also

    Dialogue

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    DeregisterFunction(string)
    FunctionExists(string)
    Library
    GetFunction(string)
    ImportLibrary(Library)
    Library
    RegisterFunction(string,Delegate)
    RegisterFunction(string,Func)
    RegisterFunction(string,Func<T1, TResult>)
    RegisterFunction(string,Func<T1, T2, TResult>)
    RegisterFunction(string,Func<T1, T2, T3, TResult>)
    RegisterFunction(string,Func<T1, T2, T3, T4, TResult>)
    RegisterFunction(string,Func<T1, T2, T3, T4, T5, TResult>)

    Dialogue

    Class in Yarn

    Inherits from System.Object

    Summary

    Co-ordinates the execution of Yarn programs.

    public class Dialogue : IAttributeMarkerProcessor

    Constructors

    Name
    Description
    Name
    Description
    Name
    Description
    Name
    Description

    Node

    Class in Yarn

    Inherits from System.Object

    Summary

    A node of Yarn script, contained within a Program , and containing Yarn.Instruction s.

    public class Node

    Methods

    Name
    Description
    Name
    Description

    Replaces all substitution markers in a text with the given substitution list.

    Returns the string ID that contains the original, uncompiled source text for a node.

    Returns the tags for the node nodeName .

    Gets a value indicating whether a specified node exists in the Program.

    Parses a line of text, and produces a containing the results.

    Prepares the that the user intends to start running a node.

    Loads all nodes from the provided .

    Signals to the that the user has selected a specified .

    Immediately stops the .

    Unloads all nodes from the Dialogue.

    Gets or sets the that is called when the dialogue reaches its end.

    Gets a value indicating whether the Dialogue is currently executing Yarn instructions.

    Gets or sets the 's locale, as an IETF BCP 47 code.

    Gets the that this Dialogue uses to locate functions.

    Gets or sets the that is called when a line is ready to be shown to the user.

    Invoked when the Dialogue needs to report debugging information.

    Invoked when the Dialogue needs to report an error.

    Gets or sets the that is called when a node is complete.

    Gets the names of the nodes in the currently loaded Program.

    Gets or sets the that is called when a node is started.

    Gets or sets the that is called when a set of options are ready to be shown to the user.

    Gets or sets the that is called when the dialogue anticipates delivering some lines.

    Gets or sets the object that provides access to storing and retrieving the values of variables.

    Dialogue(Yarn.IVariableStorage)

    Initializes a new instance of the Dialogue class.

    DefaultStartNodeName

    The node that execution will start from.

    AddProgram(Program)

    Loads the nodes from the specified Program , and adds them to the nodes already loaded.

    Continue()

    Starts, or continues, execution of the current Program.

    CommandHandler

    Gets or sets the CommandHandler that is called when a command is to be delivered to the game.

    CurrentNode

    Fields

    Methods

    Properties

    Gets the name of the node that this Dialogue is currently executing.

    The name of this node.

    the entry in the program's string table that contains the original text of this node; null if this is not available

    The tags associated with this node.

    ToString()

    Instructions

    The list of instructions in this node.

    Labels

    A jump table, mapping the names of labels to positions in the instructions list.

    Properties

    GetTagsForNode(string)

    Method in Dialogue

    Summary

    Returns the tags for the node nodeName .

    public IEnumerable<string> GetTagsForNode(string nodeName)

    Remarks

    The tags for a node are defined by setting the tags header in the node's source code. This header must be a space-separated list.

    Parameters

    Name
    Description

    The node's tags, or null if the node is not present in the Program.

    string nodeName

    The name of the node.

    Returns

    ExpandSubstitutions(string,IList)
    GetStringIDForNode(string)
    GetTagsForNode(string)
    NodeExists(string)
    ParseMarkup(string)
    MarkupParseResult
    SetNode(string)
    Dialogue
    SetProgram(Program)
    Program
    SetSelectedOption(int)
    Dialogue
    Option
    Stop()
    Dialogue
    UnloadAll()
    DialogueCompleteHandler
    DialogueCompleteHandler
    IsActive
    LanguageCode
    Dialogue
    Library
    Library
    LineHandler
    LineHandler
    LogDebugMessage
    LogErrorMessage
    NodeCompleteHandler
    NodeCompleteHandler
    NodeNames
    NodeStartHandler
    NodeStartHandler
    OptionsHandler
    OptionsHandler
    PrepareForLinesHandler
    PrepareForLinesHandler
    VariableStorage
    Name
    SourceTextStringID
    Tags

    Name

    Property in

    Gets the name of this type.

    public string Name { get; }

    Summary

    FunctionType

    BuiltinTypes

    Class in Yarn

    Inherits from System.Object

    Summary

    Contains the built-in types available in the Yarn language.

    public static class BuiltinTypes

    Properties

    Name
    Description

    Gets the type representing any value.

    Gets the type representing boolean values.

    Gets the type representing numbers.

    Gets the type representing strings.

    Gets a dictionary that maps CLR types to their corresponding Yarn types.

    Any
    Boolean
    Number
    String
    TypeMappings

    TryGetValue(string,T)

    Method in MemoryVariableStore

    Summary

    Retrieves a value of type T by name.

    public bool TryGetValue<T>(string variableName, out T result)

    Parameters

    Name
    Description

    string variableName

    Name
    Description

    true if a value named variableName of type T was retrieved; false otherwise.

    The name of the variable to retrieve the value of.

    T result

    On return, if this method returned true, contains the retrieved value. If this method returned false, contains the default value of T (for example, 0 for float values, null for strings, and so on.)

    T

    The type of the variable to retrieve.

    Type Parameters

    Returns

    VariableStorage

    Property in

    Gets or sets the object that provides access to storing and retrieving the values of variables.

    public IVariableStorage VariableStorage { get; set; }

    Summary

    Dialogue