v2.4.0
Yarn Spinner is made possible by your generous patronage. Please consider supporting Yarn Spinner's development by becoming a patron!
π©βπ Getting Help
There are several places you can go to get help with Yarn Spinner.
- Join the Yarn Spinner Discord.
- Tweet at us, at @YarnSpinnerTool.
- To report a bug, file an issue on GitHub.
π¦ How To Install Yarn Spinner
To install the most recent release of Yarn Spinner for Unity, please see the Installation Instructions in the Yarn Spinner documentation.
If you want to install this particular version of Yarn Spinner for Unity, follow these steps:
Installing Yarn Spinner for Unity v2.4.0 from Git
- 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.4.0
Each release will have a different URL. To upgrade to future versions of Yarn Spinner, you will need to uninstall the package, and reinstall using the new URL.
π Changes
Added
In-Line Pause Support
- The built-in Line View now can now identify markup based pauses and insert pauses into the typewriter effect.
- To use this you can use the
pause
markup inside your lines:Alice: wow this line now has a halt [pause=500 /] inside of it
- This line will stop the typewriter for 500ms after the
halt
is shown. After the 500ms delay, the rest of the line will appear.
- This line will stop the typewriter for 500ms after the
- Two new Unity events have also been added to be informed when pauses happen:
onPauseStarted
onPauseEnded
- To use this you can use the
- Added a new
PausableTypewriter
effect that works identically to the existingTypewriter
effect, but supports arbitrary pauses. This effect can be used in your own custom line views to add support for the[pause/]
markup. - To learn more about how the pause system works, take a look at the
PausableTypewriter.GetPauseDurationsInsideLine
method!
New Samples
- Several new sample projects have been added:
-
Shot Reverse Shot shows how you can use Cinemachine virtual cameras and custom dialogue views to make a shot-reverse-shot scene in your game.
-
Sliced Views shows off a new alternative default line and option view prefab.
-
User Input and Yarn shows how you can use blocking commands and TMP Input fields to get input into Yarn variables.
-
Pausing the Typewriter showing how you can use the
[pause/]
marker to temporarily pause in the middle of a line.
-
New Saving Features
- Added two new basic save methods on
DialogueRunner
that use the persistent data storage location as their save location:SaveStateToPersistentStorage
saves all variables known to the Dialogue Runner to a named file in the Application.persistentDataPath folder.- These methods,
SaveStateToPersistentStorage
andLoadStateFromPersistentStorage
are intended to replace the olderPlayerPref
based system for basic saves. - Note: For more complex games, we are still assuming you will need to craft your own bespoke save system.
- These methods,
Markup Palette System
-
The Line View and Options List View prefabs now support markup palettes, which allow you to customise the colours of your lines and options using Yarn Spinner's markup.
-
Markup Palettes let you associate a marker with a colour. When you use that marker in your dialogue, the text will be rendered using that colour.
-
For example, consider the following line:
I'm [excited]thrilled to be here[/excited]!
If you create a Markup Palette that links the word
excited
to the colour red, the words "thrilled to be here" will be red. -
The built-in Line View and Options List View prefabs have support for Markup Palettes, as well as any custom Dialogue Views you build that use the
LineView
andOptionsListView
classes.
Other Features
- A new method (
ClearLoadedAssets
), which unloads all cached assets from theUnityLocalisedLineProvider
, has been added.- This method will forcibly unload all assets. Only call this method if you're very familiar with the Addressable Assets system and are comfortable with Yarn Spinner's internals!
- Projects can now provide a list of line IDs within a node, using
GetLineIDsForNodes
.- This is intended to be used to precache multiple nodes worth of assets, but might also be useful for debugging during development.
- Newly created
.yarnproject
files now ignore any.yarn
files that are in a folder whose name ends in '~', which follows Unity's behaviour.- You can customise this behaviour by opening the
.yarnproject
file in a text editor and modifying theexcludeFiles
property.
- You can customise this behaviour by opening the
- Added
MarkupPalette
scriptable object and support for the palette inside ofLineView
andOptionsListView
and associatedOptionView
.- This is useful both as a standalone way to easily annotate your dialogue, but also as an example of the markup system.
Changed
- Fixed a bug where
YarnNode
attributes would not display correctly in the Inspector when its property path is longer than 1. - Fixed a bug in the action registration source code generator that caused it to crash on certain files, which resulted in some commands not being registered at runtime.
- Replaced the call to
Yarn.Compiler.Utility.AddTagsToLines
withYarn.Compiler.Utility.TagLines
. - Fixed incorrect order of generic parameter names for
AddFunction
methods. The usage of these functions is unchanged. - Fixed incorrect handling of line IDs inside the Unity Localised Line Provider preventing voice assets being loaded.
- Fixed a crash where declaration statements without a value (
<<declare $var>>
) would crash the importer, leading to weird bugs. - Yarn Functions and Commands can now have up to 10 parameters if you need them. (Previously, the limit was 6.)
- The hard dependency on Text Mesh Pro is now a soft one.
- This change will only affect projects that do not have TextMeshPro installed in their project. For most projects, this change won't be noticed.
- Dialogue Runner will now better wait for line providers to be ready before requesting lines.
- This does have the potential issue of long load times for some larger nodes, in those cases we suggest you preload more lines using
GetLineIDsForNodes
onYarnProject
- This does have the potential issue of long load times for some larger nodes, in those cases we suggest you preload more lines using
UnityLocalisedLineProvider
can now have it's default setting of removing unused assets disabled, this is useful when caching multiple nodes worth of assets- The "Add Assets to Asset Table Collection" wizard now correctly prepends
line:
to the key, to match the documented behaviour. OptionsListView
now deactivates child options when they are not needed instead of just making them transparent.- When using Unity Localization, line metadata is now stored on the shared entry for a line ID, rather than only on the base language's entry. (This caused an issue where, if the game was not running in the base language, line metadata would not be available.)
- Fixed an issue with
AudioLineProvider
that would prevent audio assets being loaded - Fixed an issue with the Project editor that prevented audio assets loading when using Addressables.
- The Yarn Project inspector window will now log errors when your inspector width is considered too small.
- We are pretty sure this is a bug in the UI code on Unity's end.
- In our testing it happens at widths less than 319 pixels, because, sure, why not!
- It also doesn't seem to happen in every version of Unity, so that's fun.
- Setting a project on the dialogue runner will now also load the initial variables from this project, fixing this regression.
LineView
now supports showing the character names as a standalone element.- The existing behaviour is still the same with the default prefabs
OptionsListView
now supports showing the character names as a standalone element.LineView
now uses thePausableTypewriter
by default.- If you don't use pauses, you won't need to change anything.
Effects.Typewriter
now is a wrapper into thePausableTypewriter
effect- If you don't use pauses nothing will change
- Yarn Projects that have no import data will no longer suggest to upgrade the project file.
- This solves an uncommon but very hard to debug error!
YarnProjectImporterEditor.CreateUpgradeUI
is now private.- The Yarn Project editor 'upgrade' help link now correctly links to the upgrade page on the docs.
Removed
- Deprecated
SaveStateToPlayerPrefs
andLoadStateFromPlayerPrefs
.- Please use
SaveStateToPersistentStorage
andLoadStateFromPersistentStorage
instead.
- Please use
- The Actions class will no longer log every single time a command is registered.
- Removed
YarnLinesAsCanvasText
class and associated elements, this didn't did anything and was using an approach that is no longer advisable.- The
MainMenu
sample is now gone, this code was not in the package and didn't work, so it is unlikely anyone will notice this has been removed.
- The
- Removed the deprecated code inside
YarnProjectImporterEditor
. - The Addressable sample has been removed for now as it isn't well suited as an example of using Yarn Spinner and Addressables. It will return in a future release of Yarn Spinner.