LogoLogo
HomepageDiscordItchPatreon
Yarn Spinner 2.4
Yarn Spinner 2.4
  • ⭐Start Here
  • 🧶Yarn Spinner Components
  • Beginner's Guide
    • Welcome
    • ➿Syntax Basics
    • 📖Writing Narratives
    • 🎮Using a Game Engine
      • Yarn Spinner for Unity
      • Yarn Spinner for Godot
      • Yarn Spinner for Rust
  • Writing Dialogue in Yarn
    • ⌨️Editing with VS Code
      • Installing the Extension
      • Writing Yarn in VS Code
      • Previewing Your Dialogue
      • Writing Together
    • ✍️Writing in Yarn
      • Nodes, Lines, and Options
      • Variables
      • Flow Control
      • Markup
      • Commands
      • Functions
      • Tags and Metadata
    • 🪄Upgrading Yarn Scripts
  • Yarn Spinner for Unity
    • Overview
    • 📦Installation for Unity
    • ⚡Unity Quick Start
    • 📥Importing Yarn Files
      • Yarn Projects
      • Yarn Scripts
    • 🧱Components
      • Dialogue Runner
      • Dialogue Views
        • Line View
        • Options List View
        • Option View
        • Creating Custom Dialogue Views
        • Dialogue Advance Input
      • Variable Storage
        • In-Memory Variable Storage
        • Custom Variable Storage Components
      • Line Provider
        • Unity Localised Line Provider
        • Text Line Provider
        • Audio Line Provider
    • 🤖Commands and Functions
    • 🗺️Localisations and Assets
      • In-built Localisation
      • Unity Localisation
    • 💡Frequently Asked Questions / "How Do I...?"
    • 🎁Unity Samples
      • Intro
  • Yarn Spinner for Unreal
    • 🧑🏼‍🏫Unreal Beta Quickstart
  • Yarn Spinner for Rust
    • Overview
    • ⚡Bevy Quick Start
    • 📥Compiling Yarn Files into Yarn Projects
    • 🧱Components
      • Dialogue Runner and a High Level Overview
      • Dialogue Views
      • Variable Storage
      • Assets
    • 🤖Custom Commands and Functions
      • Commands
      • Functions
    • 🗺️Localisations
    • 💡Frequently Asked Questions / "How Do I...?"
    • 🎁Bevy Samples
  • Yarn Spinner for Godot
    • Overview
    • 📦Installation for Godot
    • 📥Importing Yarn Files
      • Yarn Projects
      • Yarn Scripts
    • 🧱Components
      • Dialogue Runner
      • Dialogue Views
        • Line View
        • Options List View
        • Option View
        • Creating Custom Dialogue Views
      • Variable Storage
        • In-Memory Variable Storage
        • Custom Variable Storage Components
      • Line Provider
        • Text Line Provider
      • Markup Palette
    • 🤖Commands and Functions
    • 🗺️Localization
    • Advanced Guides
      • Implementing Custom Variable Storage
  • Unity Tutorial Projects
    • 🛠️Choose-Your-Path Game
    • 🛠️Choose-Your-Path Game with Visuals
    • 🛠️NPC Dialogue Game
  • Unity Add-Ons
    • ⭐About Add-Ons
    • Dialogue Wheel
      • Installing Dialogue Wheel
      • Using Six-Segment Wheel
      • Using Auto-Layout Wheel
      • Dialogue Wheel Examples
    • Speech Bubbles
      • Installing Speech Bubbles
      • Using Speech Bubbles
      • Speech Bubble Examples
  • Advanced Guides
    • Building a Custom Dialogue Runner
    • Yarn Variables and Custom Variable Storage
  • About
    • Crediting Yarn Spinner
    • The Yarn Spinner Team
    • GitHub Repositories
    • Community Projects
  • API Documentation
    • C#
      • Yarn Namespace
        • BuiltinTypes
          • Any
          • Boolean
          • Number
          • String
          • TypeMappings
        • Command
          • Text
        • CommandHandler
        • Dialogue
          • DefaultStartNodeName
          • Dialogue(Yarn.IVariableStorage)
          • AddProgram(Program)
          • Continue()
          • ExpandSubstitutions(string,IList<string>)
          • GetStringIDForNode(string)
          • GetTagsForNode(string)
          • NodeExists(string)
          • ParseMarkup(string)
          • SetNode(string)
          • SetProgram(Program)
          • SetSelectedOption(int)
          • Stop()
          • UnloadAll()
          • CommandHandler
          • CurrentNode
          • DialogueCompleteHandler
          • IsActive
          • LanguageCode
          • Library
          • LineHandler
          • LogDebugMessage
          • LogErrorMessage
          • NodeCompleteHandler
          • NodeNames
          • NodeStartHandler
          • OptionsHandler
          • PrepareForLinesHandler
          • VariableStorage
        • DialogueCompleteHandler
        • DialogueException
        • FunctionType
          • Description
          • Methods
          • Name
          • Parameters
          • Parent
          • ReturnType
        • Header
          • KeyFieldNumber
          • ValueFieldNumber
          • Header()
          • Header(Header)
          • CalculateSize()
          • Clone()
          • Equals(object)
          • Equals(Header)
          • GetHashCode()
          • MergeFrom(pb::CodedInputStream)
          • MergeFrom(Header)
          • ToString()
          • WriteTo(pb::CodedOutputStream)
          • Descriptor
          • Key
          • Parser
          • Value
        • IType
          • Description
          • Methods
          • Name
          • Parent
        • IVariableStorage
          • Clear()
          • SetValue(string,bool)
          • SetValue(string,float)
          • SetValue(string,string)
          • TryGetValue(string,T)
        • Library
          • DeregisterFunction(string)
          • FunctionExists(string)
          • GenerateUniqueVisitedVariableForNode(string)
          • GetFunction(string)
          • ImportLibrary(Library)
          • RegisterFunction(string,Delegate)
          • RegisterFunction(string,Func<TResult>)
          • 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>)
        • Line
          • ID
          • Substitutions
        • LineHandler
        • Logger
        • MemoryVariableStore
          • Clear()
          • SetValue(string,bool)
          • SetValue(string,float)
          • SetValue(string,string)
          • TryGetValue(string,T)
        • Node
          • ToString()
          • Headers
          • Instructions
          • Labels
          • Name
          • SourceTextStringID
          • Tags
        • NodeCompleteHandler
        • NodeStartHandler
        • OptionSet
          • Options
          • Option
            • DestinationNode
            • ID
            • IsAvailable
            • Line
        • OptionsHandler
        • PrepareForLinesHandler
        • Program
          • Combine(Program[])
          • LineIDsForNode(string)
          • ToString()
          • InitialValues
          • Name
          • Nodes
      • Yarn.Markup Namespace
        • MarkupAttribute
          • ToString()
          • Length
          • Name
          • Position
          • Properties
        • MarkupParseException
        • MarkupParseResult
          • Attributes
          • Text
          • DeleteRange(MarkupAttribute)
          • TextForAttribute(MarkupAttribute)
          • TryGetAttributeWithName(string,MarkupAttribute)
        • MarkupProperty
          • Name
          • Value
        • MarkupValue
          • ToString()
          • BoolValue
          • FloatValue
          • IntegerValue
          • StringValue
          • Type
        • MarkupValueType
          • Bool
          • Float
          • Integer
          • String
      • Yarn.Compiler Namespace
        • BasicBlock
          • AddDestination(string,Condition)
          • AddDestination(BasicBlock,Condition)
          • Ancestors
          • Descendants
          • DescendantsWithPlayerVisibleContent
          • Destinations
          • FirstInstructionIndex
          • Instructions
          • LabelName
          • Name
          • NodeName
          • PlayerVisibleContent
          • CommandElement
            • CommandText
          • Condition
            • DirectJump
            • ExpressionIsFalse
            • ExpressionIsTrue
            • Fallthrough
            • Option
          • Destination
            • Block
            • Condition
            • NodeName
            • Type
            • DestinationType
              • Block
              • Node
          • LineElement
            • LineID
          • OptionsElement
            • Options
            • Option
              • Destination
              • LineID
          • PlayerVisibleContentElement
        • CompilationJob
          • CompilationType
          • Files
          • Library
          • VariableDeclarations
          • CreateFromFiles(IEnumerable<string>,Library)
          • CreateFromFiles(string[])
          • CreateFromString(string,string,Library)
          • File
            • FileName
            • Source
          • Type
            • DeclarationsOnly
            • FullCompilation
            • StringsOnly
        • CompilationResult
          • ContainsImplicitStringTags
          • DebugInfo
          • Declarations
          • Diagnostics
          • FileTags
          • Program
          • StringTable
        • Compiler
          • Compile(CompilationJob)
          • FlattenParseTree(IParseTree)
          • GetDocumentComments(CommonTokenStream,ParserRuleContext,bool)
          • GetLineIDForNodeName(string)
        • DebugInfo
          • GetLineInfo(int)
          • LineInfo
            • CharacterNumber
            • FileName
            • LineNumber
            • NodeName
        • Declaration
          • ExternalDeclaration
          • CreateVariable(string,Yarn.IType,IConvertible,string)
          • Equals(object)
          • GetHashCode()
          • ToString()
          • DefaultValue
          • Description
          • IsImplicit
          • IsVariable
          • Name
          • Range
          • SourceFileLine
          • SourceFileName
          • SourceNodeName
          • Type
        • DeclarationBuilder
          • WithDefaultValue(System.IConvertible)
          • WithDescription(string)
          • WithImplicit(bool)
          • WithName(string)
          • WithRange(Yarn.Compiler.Range)
          • WithSourceFileName(string)
          • WithSourceNodeName(string)
          • WithType(IType)
          • Declaration
        • DeferredTypeDiagnostic
          • CreateDeferredTypeDiagnostic(string,Diagnostic)
          • diagnostic
          • Name
        • Diagnostic
          • Diagnostic(string,ParserRuleContext,string,DiagnosticSeverity)
          • Diagnostic(string,string,DiagnosticSeverity)
          • Diagnostic(string,DiagnosticSeverity)
          • Diagnostic(string,Range,string,DiagnosticSeverity)
          • Equals(object)
          • GetHashCode()
          • ToString()
          • Column
          • Context
          • FileName
          • Line
          • Message
          • Range
          • Severity
          • DiagnosticSeverity
            • Error
            • Info
            • Warning
        • FileParseResult
          • FileParseResult(string,IParseTree,CommonTokenStream)
          • Equals(object)
          • GetHashCode()
          • Name
          • Tokens
          • Tree
        • FunctionTypeBuilder
          • WithParameter(IType)
          • WithReturnType(IType)
          • FunctionType
        • IndentAwareLexer
          • IndentAwareLexer(ICharStream,TextWriter,TextWriter)
          • NextToken()
          • Warnings
          • Warning
            • Message
            • Token
        • InstructionCollectionExtensions
          • GetBasicBlocks(Node)
        • Position
          • Equals(object)
          • GetHashCode()
          • Character
          • Line
        • Project
          • CurrentProjectFileVersion
          • GetJson()
          • IsMatchingPath(string)
          • LoadFromFile(string)
          • SaveToFile(string)
          • BaseLanguage
          • CompilerOptions
          • Definitions
          • DefinitionsPath
          • ExcludeFilePatterns
          • FileVersion
          • Localisation
          • Path
          • SourceFilePatterns
          • SourceFiles
          • LocalizationInfo
            • Assets
            • Strings
        • Range
          • Range()
          • Range(int,int,int,int)
          • Equals(object)
          • GetHashCode()
          • End
          • Start
        • StringInfo
          • fileName
          • isImplicitTag
          • lineNumber
          • metadata
          • nodeName
          • text
          • ToString()
        • Utility
          • AddTagsToLines(string,ICollection<string>)
          • DetermineNodeConnections(string[])
          • ExtractStringBlocks(IEnumerable<Node>)
          • GenerateYarnFileWithDeclarations(IEnumerable<Yarn.Compiler.Declaration>,string,IEnumerable<string>,IDictionary<string, string>)
          • ParseSource(string)
          • TagLines(string,ICollection<string>)
      • Yarn.Compiler.Upgrader Namespace
        • LanguageUpgrader
          • Upgrade(UpgradeJob)
        • OrderedSet
          • OrderedSet()
          • OrderedSet(IEqualityComparer<T>)
          • Add(T)
          • Add(IEnumerable<T>)
          • Clear()
          • Contains(T)
          • CopyTo(T[],int)
          • GetEnumerator()
          • Remove(T)
          • Count
          • IsReadOnly
        • TextReplacement
          • Comment
          • OriginalText
          • ReplacementText
          • Start
          • StartLine
          • OriginalLength
          • ReplacementLength
        • UpgradeJob
          • Files
          • UpgradeType
          • UpgradeJob(UpgradeType,IEnumerable<CompilationJob.File>)
        • UpgradeResult
          • Files
          • Diagnostics
          • OutputFile
            • Diagnostics
            • IsNewFile
            • OriginalSource
            • Path
            • Replacements
            • UpgradedSource
        • UpgradeType
          • Version1to2
      • Yarn.Unity Namespace
        • Actions
          • Actions(DialogueRunner,Library)
          • AddCommandHandler(string,Action)
          • AddCommandHandler(string,Delegate)
          • AddCommandHandler(string,Func<IEnumerator>)
          • AddCommandHandler(string,Func<Coroutine>)
          • AddCommandHandler(string,MethodInfo)
          • AddCommandHandler(string,Action<T1>)
          • AddCommandHandler(string,Func<T1, IEnumerator>)
          • AddCommandHandler(string,Func<T1, Coroutine>)
          • AddCommandHandler(string,Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IEnumerator>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Coroutine>)
          • AddCommandHandler(string,Action<T1, T2>)
          • AddCommandHandler(string,Func<T1, T2, IEnumerator>)
          • AddCommandHandler(string,Func<T1, T2, Coroutine>)
          • AddCommandHandler(string,Action<T1, T2, T3>)
          • AddCommandHandler(string,Func<T1, T2, T3, IEnumerator>)
          • AddCommandHandler(string,Func<T1, T2, T3, Coroutine>)
          • AddCommandHandler(string,Action<T1, T2, T3, T4>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, IEnumerator>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, Coroutine>)
          • AddCommandHandler(string,Action<T1, T2, T3, T4, T5>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, IEnumerator>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, Coroutine>)
          • AddCommandHandler(string,Action<T1, T2, T3, T4, T5, T6>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, T6, IEnumerator>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, T6, Coroutine>)
          • AddCommandHandler(string,Action<T1, T2, T3, T4, T5, T6, T7>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, T6, T7, IEnumerator>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, T6, T7, Coroutine>)
          • AddCommandHandler(string,Action<T1, T2, T3, T4, T5, T6, T7, T8>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, T6, T7, T8, IEnumerator>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, T6, T7, T8, Coroutine>)
          • AddCommandHandler(string,Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IEnumerator>)
          • AddCommandHandler(string,Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, Coroutine>)
          • AddFunction(string,Delegate)
          • AddFunction(string,Func<TResult>)
          • AddFunction(string,Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>)
          • AddFunction(string,Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>)
          • AddFunction(string,Func<T1, TResult>)
          • AddFunction(string,Func<T1, T2, TResult>)
          • AddFunction(string,Func<T1, T2, T3, TResult>)
          • AddFunction(string,Func<T1, T2, T3, T4, TResult>)
          • AddFunction(string,Func<T1, T2, T3, T4, T5, TResult>)
          • AddFunction(string,Func<T1, T2, T3, T4, T5, T6, TResult>)
          • AddFunction(string,Func<T1, T2, T3, T4, T5, T6, T7, TResult>)
          • AddFunction(string,Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult>)
          • AddRegistrationMethod(Action<IActionRegistration>)
          • GetLibrary()
          • RegisterActions()
          • RemoveCommandHandler(string)
          • RemoveFunction(string)
          • SetupForProject(YarnProject)
          • Commands
          • DialogueRunner
          • Library
        • AudioLineProvider
          • audioLanguage
          • textLanguageCode
          • GetLocalizedLine(Line)
          • PrepareForLines(IEnumerable<string>)
          • LinesAvailable
          • LocaleCode
        • CharacterColorView
          • RunLine(LocalizedLine,Action)
          • CharacterColorData
            • characterName
            • displayColor
        • Culture
          • DisplayName
          • IsNeutralCulture
          • Name
          • NativeName
          • Culture(System.Globalization.CultureInfo)
        • Cultures
          • GetCulture(string)
          • GetCultures()
          • HasCulture(string)
          • CurrentNeutralCulture
        • DialogueAdvanceInput
          • continueAction
          • continueActionKeyCode
          • continueActionReference
          • continueActionType
          • dialogueView
          • enableActionOnStart
          • Action
          • ContinueActionType
            • InputSystemAction
            • InputSystemActionFromAsset
            • KeyCode
            • None
        • DialogueCharacterNameView
          • onDialogueStarted
          • onNameNotPresent
          • onNameUpdate
          • DialogueStarted()
          • RunLine(LocalizedLine,Action)
        • DialogueOption
          • DialogueOptionID
          • IsAvailable
          • Line
          • TextID
        • DialogueReference
          • nodeName
          • project
          • DialogueReference()
          • DialogueReference(YarnProject,string)
          • M:Yarn.Unity.DialogueReference.op_Implicit(Yarn.Unity.DialogueReference)~System.String
          • IsValid
        • DialogueRunner
          • dialogueViews
          • lineProvider
          • onCommand
          • onDialogueComplete
          • onDialogueStart
          • onNodeComplete
          • onNodeStart
          • runSelectedOptionAsLine
          • startAutomatically
          • startNode
          • verboseLogging
          • yarnProject
          • AddCommandHandler(string,System.Action)
          • AddCommandHandler(string,Delegate)
          • AddCommandHandler(string,System.Func<IEnumerator>)
          • AddCommandHandler(string,System.Func<Coroutine>)
          • AddCommandHandler(string,MethodInfo)
          • AddCommandHandler(string,System.Action<T1>)
          • AddCommandHandler(string,System.Func<T1, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2>)
          • AddCommandHandler(string,System.Func<T1, T2, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5, T6>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5, T6, T7>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5, T6, T7, T8>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, Coroutine>)
          • AddFunction(string,Delegate)
          • AddFunction(string,System.Func<TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>)
          • AddFunction(string,System.Func<T1, TResult>)
          • AddFunction(string,System.Func<T1, T2, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, T6, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, T6, T7, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult>)
          • Clear()
          • GetTagsForNode(String)
          • LoadStateFromPersistentStorage(string)
          • LoadStateFromPlayerPrefs(string)
          • NodeExists(string)
          • OnViewRequestedInterrupt()
          • RemoveCommandHandler(string)
          • RemoveFunction(string)
          • SaveStateToPersistentStorage(string)
          • SaveStateToPlayerPrefs(string)
          • SetDialogueViews(DialogueViewBase[])
          • SetInitialVariables(bool)
          • SetProject(YarnProject)
          • SplitCommandText(string)
          • StartDialogue(string)
          • Stop()
          • CurrentNodeName
          • Dialogue
          • IsDialogueRunning
          • VariableStorage
          • StringUnityEvent
        • DialogueViewBase
          • requestInterrupt
          • DialogueComplete()
          • DialogueStarted()
          • DismissLine(Action)
          • InterruptLine(LocalizedLine,Action)
          • RunLine(LocalizedLine,Action)
          • RunOptions(DialogueOption[],Action<int>)
          • UserRequestedViewAdvancement()
        • Effects
          • FadeAlpha(CanvasGroup,float,float,float,CoroutineInterruptToken)
          • PausableTypewriter(TextMeshProUGUI,float,Action,Action,Action,Stack<(int position, float duration)>,CoroutineInterruptToken)
          • Typewriter(TextMeshProUGUI,float,Action,CoroutineInterruptToken)
          • CoroutineInterruptToken
            • Complete()
            • Interrupt()
            • Start()
            • CanInterrupt
            • WasInterrupted
        • IActionRegistration
          • AddCommandHandler(string,System.Action)
          • AddCommandHandler(string,Delegate)
          • AddCommandHandler(string,System.Func<IEnumerator>)
          • AddCommandHandler(string,System.Func<Coroutine>)
          • AddCommandHandler(string,MethodInfo)
          • AddCommandHandler(string,System.Action<T1>)
          • AddCommandHandler(string,System.Func<T1, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2>)
          • AddCommandHandler(string,System.Func<T1, T2, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5, T6>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5, T6, T7>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5, T6, T7, T8>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, Coroutine>)
          • AddCommandHandler(string,System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IEnumerator>)
          • AddCommandHandler(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, Coroutine>)
          • AddFunction(string,Delegate)
          • AddFunction(string,System.Func<TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>)
          • AddFunction(string,System.Func<T1, TResult>)
          • AddFunction(string,System.Func<T1, T2, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, T6, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, T6, T7, TResult>)
          • AddFunction(string,System.Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult>)
          • RemoveCommandHandler(string)
          • RemoveFunction(string)
        • ICommand
          • Name
        • InMemoryVariableStorage
          • showDebug
          • Clear()
          • Contains(string)
          • GetAllVariables()
          • GetDebugList()
          • SetAllVariables(Dictionary<string, float>,Dictionary<string, string>,Dictionary<string, bool>,bool)
          • SetValue(string,bool)
          • SetValue(string,float)
          • SetValue(string,string)
          • TryGetValue(string,T)
        • LanguageAttribute
        • LineMetadata
          • GetLineIDs()
          • GetMetadata(string)
        • LineProviderBehaviour
          • GetLocalizedLine(Yarn.Line)
          • PrepareForLines(IEnumerable<string>)
          • Start()
          • LinesAvailable
          • LocaleCode
          • YarnProject
        • LineView
          • DialogueComplete()
          • DismissLine(Action)
          • GetPauseDurationsInsideLine(Markup.MarkupParseResult)
          • InterruptLine(LocalizedLine,Action)
          • OnContinueClicked()
          • PaletteMarkedUpText(Markup.MarkupParseResult,MarkupPalette)
          • RunLine(LocalizedLine,Action)
          • UserRequestedViewAdvancement()
        • Localization
          • AddLocalizedObject(string,T)
          • AddLocalizedObjects(IEnumerable<KeyValuePair<string, T>>)
          • AddLocalizedString(string,string)
          • AddLocalizedStrings(IEnumerable<KeyValuePair<string, string>>)
          • AddLocalizedStrings(IEnumerable<StringTableEntry>)
          • Clear()
          • ContainsLocalizedObject(string)
          • ContainsLocalizedString(string)
          • GetLineIDs()
          • GetLocalizedObject(string)
          • GetLocalizedString(string)
          • SetLocalizedObject(string,T)
          • ContainsLocalizedAssets
          • LocaleCode
          • UsesAddressableAssets
        • LocalizationType
          • Unity
          • YarnInternal
        • LocalizedLine
          • Asset
          • Metadata
          • RawText
          • Substitutions
          • TextID
          • CharacterName
          • Text
          • TextWithoutCharacterName
        • MarkupPalette
          • ColourMarkers
          • ColorForMarker(string,Color)
          • ColorMarker
            • Color
            • Marker
        • OptionsListView
          • DialogueComplete()
          • OnEnable()
          • Reset()
          • RunLine(LocalizedLine,Action)
          • RunOptions(DialogueOption[],Action<int>)
          • Start()
        • OptionView
          • OnOptionSelected
          • palette
          • InvokeOptionSelected()
          • OnPointerClick(PointerEventData)
          • OnPointerEnter(PointerEventData)
          • OnSubmit(BaseEventData)
          • Option
        • SampleRenderDetector
        • SerializedDictionary
          • Add(TKey,TValue)
          • Add(KeyValuePair<TKey, TValue>)
          • Clear()
          • Contains(KeyValuePair<TKey, TValue>)
          • ContainsKey(TKey)
          • CopyTo(KeyValuePair<TKey, TValue>[],int)
          • GetEnumerator()
          • Remove(TKey)
          • Remove(KeyValuePair<TKey, TValue>)
          • TryGetValue(TKey,TValue)
          • Count
          • IsReadOnly
          • this[TKey key]
          • Keys
          • Values
        • StringTableEntry
          • Comment
          • File
          • ID
          • Language
          • LineNumber
          • Lock
          • Node
          • Text
          • StringTableEntry(StringTableEntry)
          • CreateCSV(IEnumerable<StringTableEntry>)
          • Equals(object)
          • GetHashCode()
          • ParseFromCSV(string)
          • ToString()
        • TextLineProvider
          • textLanguageCode
          • GetLocalizedLine(Yarn.Line)
          • PrepareForLines(IEnumerable<string>)
          • LinesAvailable
          • LocaleCode
        • VariableStorageBehaviour
          • Clear()
          • Contains(string)
          • GetAllVariables()
          • SetAllVariables(FloatDictionary,StringDictionary,BoolDictionary,bool)
          • SetValue(string,bool)
          • SetValue(string,float)
          • SetValue(string,string)
          • TryGetValue(string,T)
        • VoiceOverView
          • audioSource
          • fadeOutTimeOnLineFinish
          • waitTimeAfterLineComplete
          • waitTimeBeforeLineStart
          • DialogueComplete()
          • DismissLine(Action)
          • InterruptLine(LocalizedLine,Action)
          • RunLine(LocalizedLine,Action)
          • UserRequestedViewAdvancement()
        • YarnActionAttribute
          • Name
        • YarnCommandAttribute
          • Injector
        • YarnFunctionAttribute
        • YarnNodeAttribute
          • yarnProjectAttribute
        • YarnParameterAttribute
          • Injector
        • YarnProject
          • baseLocalization
          • compiledYarnProgram
          • lineMetadata
          • localizations
          • localizationType
          • searchAssembliesForActions
          • GetHeaders(string)
          • GetLineIDsForNodes(IEnumerable<string>)
          • GetLocalization(string)
          • InitialValues
          • NodeNames
          • Program
        • YarnStateInjectorAttribute
          • Injector
      • Yarn.Unity.UnityLocalization Namespace
        • UnityLocalisedLineProvider
          • GetLocalizedLine(Yarn.Line)
          • PrepareForLines(IEnumerable<string>)
          • Start()
          • LinesAvailable
          • LocaleCode
    • Rust
      • bevy_yarnspinner
      • bevy_yarnspinner_example_dialogue_view
      • yarnspinner
Powered by GitBook

Community

  • Discord
  • Bluesky
  • Mastodon
  • Itch

Yarn Spinner® and Secret Lab® are trade marks of Secret Lab Pty. Ltd., and are used by Yarn Spinner Pty. Ltd. under license.

On this page
  • Creating a New Yarn Project
  • Adding Yarn scripts to a Yarn Project
  • Creating a Project from a Script
  • Managing Variables
  • Managing Localisations and Assets
  • Using Yarn Projects with Dialogue Runners
  • Inspector
  • Upgrading Yarn Projects

Was this helpful?

Edit on GitHub
Export as PDF
  1. Yarn Spinner for Unity
  2. Importing Yarn Files

Yarn Projects

Learn about Yarn Projects, which group your scripts together for use in a Dialogue Runner.

PreviousImporting Yarn FilesNextYarn Scripts

Last updated 1 year ago

Was this helpful?

A Yarn Project is a file that links multiple together. Yarn projects are how Dialogue Runners work with your content.

If you are upgrading your version of Yarn Spinner from version 2.2 or earlier, you will need to upgrade your Yarn Project. See to learn how to do this.

Creating a New Yarn Project

To create a new Yarn Project, follow these steps:

  • Open the Assets menu, and choose Yarn Spinner -> Yarn Project.

  • Unity will create a new file. Type in a name for the file, and press return.

Adding Yarn scripts to a Yarn Project

On their own, a Yarn Project doesn't do anything. In order to be useful, you need to add Yarn scripts to it.

Yarn Projects include all Yarn Scripts that the project finds in the Source Files directory. By default, that means all Yarn Scripts in the same directory as the Yarn Project, and all of that directory's children.

When you add a Yarn Script to the same folder as a Yarn Project, it will automatically be included in the Yarn Project. When you make changes to the script, the Yarn Project will automatically be re-imported.

You can change the locations that a Yarn Project looks for Yarn Scripts by modifying the Source Files setting. Each entry in the Source Files setting is a search pattern.

Pattern
Description
Examples

*

any filename

"*.yarn" will find "One.yarn" and "Two.yarn".

**/*

any path, including subdirectories

"**/*.yarn" will find "One.yarn" and "Subfolder/Two.yarn".

..

the parent folder

"../*.yarn" will find "One.yarn" in the parent folder.

You can add as many entries to the Source Files field as you like. If a file is matched by multiple patterns, it will only be included once.

A Yarn script can be included in more than one Yarn Project.

Creating a Project from a Script

You can create a new Yarn Project from a script. To do this, follow these steps:

  • Select the Yarn script in the Project pane.

  • In the Inspector, click the Create New Yarn Project button.

  • Clicking this button does two things:

    • A new Yarn Project will be created next to the Yarn script.

    • The new Yarn Project will include the Yarn script you created it from in its list of source scripts.

Managing Variables

The Inspector will show information about every variable in the project. If you use a declare statement to declare a variable, you can control the initial value of a variable, as well as its description. If you don't declare a variable, Yarn Spinner will attempt to figure the variable's type out based on how it's used, and won't be able to provide a description.

Managing Localisations and Assets

When you write a Yarn script, you write it in a specific human language. This is referred to as the 'base' language of the script. It's called the base language because it's the one you start with, and the one you translate into other languages.

Unless you change it to something else, Yarn Spinner will set the base language to your computer's current locale.

You can set the base language of a Yarn Project in the Inspector by changing the Base Language setting.

Using Yarn Projects with Dialogue Runners

Yarn Projects are used by Dialogue Runners. When a Dialogue Runner is told to start running dialogue, it reads it from the Yarn Project it's been provided.

If you try to start a Dialogue Runner and it doesn't have a Yarn Project, or the Yarn Project doesn't have any Yarn scripts, or if any of the Yarn scripts contain an error, the Dialogue Runner won't be able to run.

Inspector

Property
Description

Source Scripts

The list of places that this Yarn Project looks for Yarn Scripts.

Base Language

The language that the Yarn Scripts are written in.

Localisations

A mapping of languages to string tables and associated assets.

Use Addressable Assets

This checkbox will only appear if the Addressable Assets package is installed in your project, and if the project is not using the Unity Localisation System.

Use Unity Localisation System

If this is turned on, the Yarn Project will use the Unity Localisation System to store line data in.

This checkbox will only appear if the Localisation package is installed in your project.

Unity Localisation String Table

The String Table Collection that the Yarn Project uses. When the project is imported or reimported, this String Table will be filled with line content that comes from the project's Yarn Scripts.

This field will only appear if project is using the Unity Localisation system.

Export Strings as CSV

Update Existing Strings Files

When you click this button, all .csv strings files that are configured in the Languages to Source Assets list will be updated with any lines that have been added, modified or deleted since the strings file was created.

Add Line Tags to Scripts

Upgrading Yarn Projects

If you are upgrading your version of Yarn Spinner from version 2.2 or earlier, you will need to upgrade your Yarn Project. To do this, select the Yarn Project, and click Upgrade Yarn Project.

You will also need to either move all of your Yarn Scripts into the same folder as the Yarn Project, or update the Yarn Project's Source Files setting to tell the Yarn Project where to find your scripts.

Watch a video where Yarn Spinner developer Jon Manning walks you through upgrading a Yarn Project:

A Yarn Project's inspector shows information about every that are used in the Yarn scripts. This section of the Inspector shows the name, type, description, and default value of each variable.

If you want to translate your scripts into another language, or if you want to associate each line with assets (like voice over audio clips), you create a new Localisation. To learn about this process, see .

This list will only appear if the project is not using the Unity Localisation system. See for more information.

If this is turned on, the Yarn Project will be set up to tell other parts of the game that localised assets like audio files should be fetched using the system.

When you click this button, all of the lines in the Yarn Scripts that this project uses will be written to a .csv file, which can be translated to other languages. See for more information.

This checkbox will only appear if the project is not usin the Unity Localisation system. See for more information.

When you click this button, any line of dialogue in the Source Scripts list that doesn't have a #line: tag will have one added. See for more information.

After upgrading your Yarn Project, you will need to set up any localisations you had previously configured on your project. Follow the instructions in or , depending on what your game is using.

📥
variable
Adding Localizations and Assets to Projects
Built-In Localisation System
Unity Localisation
Adding Localizations and Assets to Projects
Addressable Assets
Adding Localizations and Assets to Projects
Adding Localizations and Assets to Projects
Adding Localizations and Assets to Projects
Yarn scripts
Upgrading Yarn Projects
The Yarn Project inspector. The configurable properties of the Yarn Project are visible at the top, and the information about the imported project is visible at the bottom.
Creating a new Yarn project.
An example of a custom Source Files setting. In this example, the Yarn Project will use all .yarn files in the same folder and its sub-folders, as well as the file Common.yarn in the folder above it.
The 'Create New Yarn Project' button in the Inspector.
The list of variables in a Yarn Project.
Updating the base language of a Yarn Project
Upgrading an old-style Yarn Project from Yarn Spinner 2.2 or earlier