Skip to content

Releases: YarnSpinnerTool/YarnSpinner-Unity

v2.0.0 Beta 1

20 Oct 01:39
Compare
Choose a tag to compare
v2.0.0 Beta 1 Pre-release
Pre-release

Yarn Spinner 2.0 Beta 1 Release Notes

This document describes the important changes to Yarn Spinner 2.0, with particular focus on breaking changes.

Note! This is not the most recent version of Yarn Spinner; to see it, go to the releases list!

This is a little long, but it's important, so we really appreciate you taking the time to read it. And while you're here, please consider becoming a patron of the project, so that we can keep making Yarn Spinner the best it can be.

We are tremendously grateful to every single person who's contributed to version 2.0. We'd especially like to thank @Schroedingers-Cat, for helping to figure out the Dialogue Views and Localisation systems, and to @radiatoryang for contributing some fantastic sample projects.

Thank you!

❤️

The Yarn Spinner Team

🐛 This Beta Is Buggy; It's A Work In Progress; Please Tell Us About The Bugs So We Can Fix Them; Thank You

YarnSpinner-UnderConstruction-5FPS

This is a beta version of Yarn Spinner 2.0. The majority of the important work has been done, but we have not finished working on it. There are almost certainly bugs in here that render this version not ready for use in your game. Additionally, future beta versions can and will change the language and API.

Beta documentation for the API is available at yarnspinner.dev/api/beta.

Please file bugs on this beta! We want to make it as solid and bug-free as we can, so if you encounter a problem, please file an issue.

🎬 The Most Important Parts

If you're in a hurry, we've prepared some videos that show you the most significant new changes in Yarn Spinner 2.0.

👩‍🚒 Getting Help

There are several places you can go to get help with the Yarn Spinner beta.

📦 How To Install Yarn Spinner 2.0 Beta 1

The beta is available as a Unity package, using a Git URL. Additional download options will be available for the final release.

To install Yarn Spinner 2.0 Beta 1 into your Unity project, follow these steps:

  • Open the Window menu, and choose Package Manager.
  • If you already have the Yarn Spinner package installed, remove it.
  • Click the + button, and click Add package from git URL...
  • Enter the following URL:
    • https://github.com/YarnSpinnerTool/YarnSpinner-Unity.git#v2.0.0-beta1

Each beta will have a different URL. To upgrade to future versions of the Yarn Spinner 2.0 beta, you will need to uninstall the package, and reinstall using the new URL.

🚨 Known Issues and Missing Features

🖍 The Yarn language syntax has changed

Syntax changes to the Yarn language itself mean that you will almost certainly find that your code no longer compiles like it did. This document outlines what those changes are, and what changes need to happen to your code to fix them.

In future beta versions of 2.0, we will be shipping tools that perform automated upgrades of your scripts. In this first beta, you'll need to upgrade your scripts manually.

📥 Importing Yarn Scripts

In Yarn Spinner 1.0, .yarn files were individually added to the Yarn Programs list in your Dialogue Runner.
In Yarn Spinner 2.0, .yarn files are now added to a new 'Yarn Program' asset, and this single asset is added to the Yarn Program field in your Dialogue Runner.

Individual .yarn scripts are now combined into a single 'Yarn Program', which is what you provide to your DialogueRunner. You no longer add multiple .yarn files to a DialogueRunner. To create a new Yarn Program, open the Asset menu, and choose Create -> Yarn Spinner -> Yarn Program. You can also create a new Yarn Program by selecting a Yarn Script, and clicking Create New Yarn Program.

💁‍♂️ Variables must be declared

Version 2 of the Yarn language requires variables to be declared in order to be used. You can declare them in your .yarn scripts, or you can declare them in the Inspector for your Yarn Program.

Variables must always have a defined type, and aren't allowed to change type. This means, for example, that you can't store a string inside a variable that was declared as a number.

Variables must also have a default value. As a result, variables are never allowed to be null.

Variable declarations can be in any part of a Yarn script. As long as they're somewhere in the file, they'll be used. You can also declare your variables in the Yarn Program itself.

  • To declare a variable on a Yarn Program, select it, and click the + button to create the new variable.

  • To declare a variable in a script, use the following syntax:

<<declare $variable_name = "hello">> // declares a string
<<declare $variable_name = 123>> // declares a number
<<declare $variable_name = true>> // declares a boolean

Variable declarations don't have to be in the same file as where they're used. If the Yarn Program contains a script that has a variable declaration, other scripts in that Program can use the variable.

🔍 Dialogue Views replace DialogueUI

In Yarn Spinner 1.0, the component that presents lines, options and commands to the player is the DialogueUI component. The DialogueRunner had a single DialogueUI, which it sent all of its content to. If you wanted to create your own custom UI for presenting dialogue to the player, you were encouraged to make your own class based off its code, and modify it to suit your needs.

In Yarn Spinner 2.0, we've made the line presentation system a little more flexible, through the use of dialogue views. A dialogue view is a component that receives lines and options. (Commands are handled by the Dialogue Runner, via either methods that have the YarnCommand attribute, or via the Dialogue Runner's AddCommandHandler method.)

The main difference between Yarn Spinner 1.0 and 2.0 is that while you were limited to a single DialogueUI, in 2.0 you can have multiple dialogue views. Each view can do a different thing; for example, you might have one view that displays the text of a line on screen, another that handles audio playback, and another that displays a portrait of the currently speaking character.

Line views are also able to interrupt each other. When a line view calls the MarkLineComplete method, the line becomes interrupted, and all line views are notified (and should do things like quickly finish displaying all text, or quickly fading out the audio.)

When a line view has finished presenting its line - for example, all of the text has appeared, or the audio has finished playing - it sends a signal that it's finished. When all line views have finished, the line becomes delivered, and the dialogue runner may choose to send another line (or wait for a signal from the player.)

The Yarn Spinner 2.0 beta ships with several examples of line views. In particular:

  • The DialogueUI class is now a dialogue view.
  • VoiceOverPlaybackUnity is a dialogue view that presents voiceover audio for a line, using Unity's built-in audio components.
  • VoiceOverPlaybackFmod is a a dialogue view that presents voiceover audio for a line, using Fmod (if it's installed.)

Examples

Line views are used in every sample that ships with Yarn Spinner 2.0. If you'd like to see them in action, take a look at these samples:

  • Start Here: This sample makes use of two line views: one to display the text (FadingLineView), and one to present voice-over audio (VoiceOverPlaybackUnity).
  • Visual Novel: This sample doesn't feature voi...
Read more

v1.2.6

21 Jun 04:01
Compare
Choose a tag to compare

Yarn Spinner v1.2.6 is a bug-fix release, and addresses import issues in Unity 2019.

Yarn Spinner is made possible by your generous patronage. Please consider supporting Yarn Spinner's development by becoming a patron!

Changed

  • Fixed compiler issues in Unity 2019.3 and later by adding an explicit reference to YarnSpinner.dll in YarnSpinnerTests.asmdef

v1.2.0

04 Jun 10:43
Compare
Choose a tag to compare

Yarn Spinner v1.2 adds a variety of bug fixes and quality-of-life improvements.

Yarn Spinner is made possible by your generous patronage. Please consider supporting Yarn Spinner's development by becoming a patron!

Note: This release is identical to the 1.2.0 release of the core repo, to make it easier to find the download as Yarn Spinner for Unity moves to a new repository.

Added

  • Yarn scripts now appear with Yarn Spinner icon. (@Schroedingers-Cat)
  • Documentation is updated to reflect the current version number (also to mention 2018.4 LTS as supported)
  • Added a button in the Inspector for .yarn files in Yarn Spinner for Unity, which updates localised .csv files when the .yarn file changes. (@stalhandske, YarnSpinnerTool/YarnSpinner#227)
  • Added handlers for when nodes begin executing (in addition to the existing handlers for when nodes complete.) (@arendhil, YarnSpinnerTool/YarnSpinner#222)
  • OptionSet.Option now includes the name of the node that an option will jump to if selected.
  • Added unit tests for Yarn Spinner for Unity (@Schroedingers-Cat)
  • Yarn Spinner for Unity: Added a menu item for creating new Yarn scripts (Assets -> Create -> Yarn Script)
  • Added Nuget package definitions for YarnSpinner and YarnSpinner.Compiler.

Changed

  • Fixed a crash in the compiler when parsing single-character commands (e.g. <<p>>) (YarnSpinnerTool/YarnSpinner#231)
  • Parse errors no longer show debugging information in non-debug builds.