Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

DescriptiveLineTagGenerator

Creates line ids in a form that attempts to approximate how a person would manually tag lines.
public class DescriptiveLineTagGenerator : ILineTagGenerator

Inherits from System.Object

Implements Yarn.Compiler.ILineTagGenerator

If you had a yarn node like the following:

    title: Node
    subtitle: Subtitle
    when: always
    ---
    Alice: This is me saying a line
    Alice: And another line
    <<some command>>
    Bob: And me responding
    And finally a line that isn't from a character
    ===
    
This would make the following tags
  1. #line:Node.Subtitle_0100_Alice
  2. #line:Node.Subtitle_0200_Alice
  3. #line:Node.Subtitle_0300_Bob
  4. #line:Node.Subtitle_0400

Where possible the tagger will attempt to add numbers equally in-between existing tags. Meaning if you had this yarn:

    title: Node
    subtitle: Subtitle
    when: always
    ---
    Alice: This is me saying a line #line:Node.Subtitle_0100_Alice
    Bob: We added a retort here
    Alice: And another line #line:Node.Subtitle_0200_Alice
    <<some command>>
    Bob: And me responding #line:Node.Subtitle_0300_Bob
    And finally a line that isn't from a character #line:Node.Subtitle_0400
    ===
    
The line "Bob: We added a retort here" would get given the #line:Node.Subtitle_0150_Bob tag.

If it isn't possible to fit the number of tags in-between existing tagged lines the tagger will start adding generational information to repeated tags. In the following Yarn we have two tags that have no space between them.

    title: Node
    subtitle: Subtitle
    when: always
    ---
    Alice: This is me saying a line #line:Node.Subtitle_0100_Alice
    Bob: I have a retort #line:Node.Subtitle_0101_Bob
    ===
    
This means any lines added in-between #line:Node.Subtitle_0100_Alice and #line:Node.Subtitle_0101_Bob can't be given a unique number So adding a line in-between requires adding a generation: ///
    title: Node
    subtitle: Subtitle
    when: always
    ---
    Alice: This is me saying a line #line:Node.Subtitle_0100_Alice
    Alice: And saying a bit more
    Bob: I have a retort #line:Node.Subtitle_0101_Bob
    ===
    
Running the tagger over this would result in the "Alice: And saying a bit more" line being given the #line:Node.Subtitle_0101_g1_Alice line id. The _g1 represents the generation of the 0101 indexed line in the node. Each indexed line can have as many generations as necessary. This means if we were to add another line in-between 0100 and 0101 it's generation number will be 2, but it could be above or below the line with the first generation.

#Methods

#GenerateLineTag(string, int)

Generates a unique line tag.
public string GenerateLineTag(string node, int lineIndex)

Parameters

  • nodestring
    The node in which the line exist
  • lineIndexint
    The relative line number of the dialogue.

Returns String: The generated line tag.

#PrepareForLines(Dictionary<string, List<ILineTagGenerator.LineTagContext>>, HashSet<string>)

public void PrepareForLines(Dictionary<string, List<ILineTagGenerator.LineTagContext>> LineContexts, HashSet<string> excludedIDs)

Parameters

  • LineContextsDictionary<string, List<Yarn.Compiler.ILineTagGenerator.LineTagContext>>
  • excludedIDsHashSet<string>

Generated from Yarn Spinner for Unity 3.3.