Yarn Spinner 2.0 Beta 4 is a hotfix release for Yarn Spinner 2.0 Beta 3. It fixes an issue that caused Yarn Spinner to not compile on Unity 2018 or Unity 2019.
The release notes for Beta 3 follow:
If you haven't read the release notes for the first and second betas, we strongly suggest you read those first to learn what's new in Yarn Spinner 2.0!
This is a pre-release version of Yarn Spinner for Unity. It is not yet considered ready for production use.
Yarn Spinner is made possible by your generous patronage. Please consider supporting Yarn Spinner's development by becoming a patron!
🚨 The Most Important Parts
This release contains significant changes to the workflow compared to previous betas. The most important are:
- Yarn Programs have been renamed Yarn Projects.
- Because this is a change to the name of a type, any references to Yarn Programs will need to be set up again.
- You no longer create Localisation assets yourself. They're generated for you by the Yarn Project.
- Localised assets, such as voice-over clips, are now automatically located and set up (you no longer need to occasionally manually refresh the localisation system.)
- The Localisation Database asset has been removed, and you don't need to create or use them.
- Yarn Projects now serve the same function.
- Addressable Assets no longer require a separate workflow and components. The same components used for direct asset references now also support Addressable Assets.
- You no longer specify a list of supported languages in your project settings.
- The list of available languages is now defined by the Yarn Project, and the specific language to use is determined by the Line Provider that your Dialogue Runner is using.
- If the appropriate language cannot be found for the selected language, the original language of your Yarn Project is used.
- A new dialogue prefab, found in Packages > Yarn Spinner > Prefabs > Dialogue System, has been added.
- This prefab makes use of new, more customisable dialogue views. This prefab is designed to be a complete solution for games to use, while also being a useful jumping-off point for building custom interfaces.
- The majority of the Sample projects, including
Intro
,VisualNovel
, and3D
, have been updated to use these new dialogue views, to demonstrate how they can be used.
👩🚒 Getting Help
There are several places you can go to get help with the Yarn Spinner beta.
- Join the Yarn Spinner Discord.
- Tweet at us, at @YarnSpinnerTool, or use the #YS2beta hashtag.
- To report a bug, file an issue on GitHub.
📦 How To Install Yarn Spinner 2.0 Beta 4
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 4 into your Unity project, follow these steps:
- Open the Window menu, and choose Package Manager.
- If you already have any previous version of 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-beta4
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.
Added
- The dialogue runner can now be configured to log less to the console, reducing the amount of noise it generates there. (@radiatoryang)
- Warning messages and errors now appear to help users diagnose two common problems: (1) not adding a Command properly, (2) can't find a localization entry for a line (either because of broken line tag or bad connection to Localization Database) (@radiatoryang)
- Made options that have a line condition able to be presented to the player, but made unavailable.
- This change was made in order to allow games to conditionally present, but disallow, options that the player can't choose. For example, consider the following script:
TD-110: Let me see your identification.
-> Of course... um totally not General Kenobi and the son of Darth Vader.
Luke: Wait, what?!
TD-110: Promotion Time!
-> You don't need to see his identification. <<if $learnt_mind_trick is true>>
TD-110: We don't need to see his identification.
- If the variable
$learnt_mind_trick
is false, a game may want to show the option but not allow the player to select it (i.e., show that this option could have been chosen if they'd learned how to do a mind trick.) - In previous versions of Yarn Spinner, if a line condition failed, the entire option was not delivered to the game. With this change, all options are delivered, and the
OptionSet.Option.IsAvailable
variable containsfalse
if the condition was not met, andtrue
if it was (or was not present.) - The
DialogueUI
component now has a "showUnavailableOptions" option that controls the display behaviour of unavailable options. If it's true, then unavailable options are presented, but not selectable; if it's false, then unavailable options are not presented at all (i.e. same as Yarn Spinner 1.0.) - Audio for lines in a
Localization
object can now be previewed in the editor. (@radiatoryang) - Lines can be added to a
Localization
object at runtime. They're only stored in memory, and are discarded when gameplay ends. - Commands that take a boolean parameter now support specifying that parameter by its name, rather than requiring the string
true
. - For example, if you have a command like this:
[YarnCommand("walk")]
void WalkToPoint(string destinationName, bool wait = false) {
// ...
}
Previously, you'd need to use this in your Yarn scripts:
<<walk MyObject MyDestination true>>
With this change, you can instead say this:
<<walk MyObject MyDestination wait>>
- New icons for Yarn Spinner assets have been added.
- New dialogue views,
LineView
andOptionListView
, have been added. These are intended to replace the previousDialogueUI
, make use of TextMeshPro for text display, and allow for easier customisation through prefabs. DialogueRunner
s will now automatically create and use anInMemoryVariableStorage
object if one isn't provided.- The Inspector for
DialogueRunner
has been updated, and is now easier to use.
Changed
- Certain private methods in
DialogueUI
have changed to protected, making it easier to subclass (@radiatoryang) - Fixed an issue where option buttons from previous option prompts could re-appear in later prompts (@radiatoryang)
- Fixed an issue where dialogue views that are not enabled were still being waited for (@radiatoryang)
- Upgrader tool now creates new files on disk, where needed (for example, .yarnproject files)
YarnProgram
, the asset that stores references to individual .yarn files for compilation, has been renamed toYarnProject
. Because this change makes Unity forget any existing references to "YarnProgram" assets, when upgrading to this version, you must set the Yarn Project field in your Dialogue Runners again.Localization
, the asset that mapped line IDs to localized data, is now automatically generated for you by theYarnProject
.- You don't create them yourselves, and you no longer need to manually refresh them.
- The
YarnProject
always creates at least one localization: the "Base" localization, which contains the original text found in your.yarn
files. - You can create more localizations in the
YarnProject
's inspector, and supply the language code to use and a.csv
file containing replacement strings.
- Renamed the 'StartHere' demo to 'Intro', because it's not actually the first step in installing Yarn Spinner.
- Simplified the workflow for working with Addressable Assets.
- You now import the package, enable its use on your Yarn Project, and click the Update Asset Addresses button to ensure that all assets have an address that Yarn Spinner knows about.
- The 3D, VisualNovel, and Intro examples have been updated to use the new
LineView
andOptionsListView
components, rather thanDialogueUI
. DialogueRunner.ResetDialogue
is now marked as Obsolete (it had the same effect as just callingStartDialogue
anyway.)- The
LineStatus
enum's values have been renamed, to better convey their purpose:Running
is nowPresenting
.Interrupted
remains the same.Delivered
is nowFinishedPresenting
.Ended
is nowDismissed
.
- The
ResetDialogue()
method now takes an optional parameter to restart from. If none is provided, the dialogue runner attempts to restart from the start node, followed by the current node, or else throws an exception. DialogueViewBase.MarkLineComplete
, the method for signalling that the user wants to interrupt or proceed to the next line, has been renamed toReadyForNextLine
.DialogueRunner.continueNextLineOnLineFinished
has been renamed toautomaticallyContinueLines
.
Removed
LocalizationDatabase
, the asset that stored references toLocalization
assets and manages per-locale line lookups, has been removed. This functionality is now handled byYarnProject
assets. You no longer supply a localization database to aDialogueRunner
or to aLineProvider
- the work is handled for you.AddressableAudioLineProvider
has been removed.AudioLineProvider
now works with addressable assets, if the package is installed and your Yarn Project has been configured to use them.- You no longer specify a list of languages available to your project in the Preferences menu or in the project settings. This is now controlled from the Yarn Project.
- The
StartDialogue()
method (with no parameters) has been removed. Instead, provide a node name to start from when callingStartDialogue(nodeName)
.