Releases: YarnSpinnerTool/YarnSpinner
v0.9.10.2
Version v0.9.10.2 includes several enhancements and bug-fixes.
Some highlights include:
- We now automatically generate documentation. You can find it at: http://thesecretlab.github.io/YarnSpinner/html/
- A new experimental ANTLR-based parser is being worked on. You can enable it by setting
experimentalModeon yourDialogueobject totrue. - We now support the new .yarn.txt format, which is much more easy to diff. The Yarn editor can save this format.
v0.9.9
Yarn Spinner v0.9.9 comes with several new, large features.
Automatic Commands in Unity
If you add a YarnCommand attribute to any method on any script attached to an object, Yarn Spinner will now automatically call it for you when it encounters a command.
For example, say you've got a game object in your scene called "Sally", and this object has the following script component attached to it:
public class MoveToPoint : MonoBehaviour {
[YarnCommand("move")]
public void Move(string destination) {
// start walking towards 'destination'
}
}
And you've also got a Yarn script that looks like this:
Sally: Where did I put that fuel tank?
<<move Sally fuelTank>>
Sally: Ah, here it is.
When the script hits the command, the Move method on Sally's MoveToPoint script will be called, with the parameter "fuelTank".
Yarn Spinner will automatically dispatch a comand like this when all of the following are true:
- The command has at least two words
- The second word is the name of a game object in the scene ("Sally", in the earlier example)
- The game object has a script that contains a method with the
YarnCommandattribute, and that attribute's parameter is the same as the first word ("move", in the earlier example). - The method with this attribution only takes strings as parameters.
If Yarn Spinner can't dispatch a command automatically, your code will instead receive the full text of the command, as before.
Variables can now be different types
Previously, variables could only store numbers. Now, they can store any of the following types:
- Numbers
- Strings
- Booleans (i.e. true or false)
- Null (i.e. no value)
These are represented as Yarn.Value objects, which represent a single "value" that Yarn can know about.
To support this, your VariableStorageBehaviour subclass should now implement GetValue and SetValue, instead of GetNumber and SetNumber.
Important: For compatibility, we provide default implementations of GetValue and SetValue that simply call the older, obsolete GetNumber and SetNumber. This means that your projects will continue to work without you doing anything. However, this will change in a future version of Yarn Spinner. You should update your code to use GetValue and SetValue as soon as possible. The Yarn Spinner editor window in Unity will warn you if your variable storage classes still implement the old methods.
This feature is thanks to @konistehrad, who is an excellent person.
Floating point numbers
You can now use floating point numbers in Yarn:
<<set $one_half to (1 / 2 == 0.5)>>
<<if (0.1 + 0.1 == 0.2)>>
Math works!
<<endif>>
Unused variable checker
The Yarn Spinner editor window in Unity (choose Window->Yarn Spinner to see it) will now show you if there are any variables that you're reading from but never assigning a value to, or are assigning a value to but not reading from. This usually happens when you make a typo:
New lexer
The lexer is a part of the compiler that converts the raw text of your Yarn scripts into a collection of tokens - individual elements of Yarn's syntax, like parentheses, <<, and numbers. This has now been replaced with a better-designed one, based on the lessons that were learned from the older implementation; the new one is much easier to extend and expand.
You shouldn't see any difference between the old version and the new version, but if you encounter any problems in your scripts that you weren't encountering in the previous version, please log an issue.
v0.9.8
Yarn Editor Window
Yarn Spinner now adds an editor window to Unity, which gives you tools for managing with your Yarn Scripts.
You can access the window by opening the Window menu and choosing Yarn Spinner, or by pressing Control-Shift-Y (Command-Shift-Y on Macs).
In this release, the Yarn Spinner editor window shows a list of all JSON files in your project, and shows you any parse errors that were encountered.
This window is brand new, and very much in beta. Please log issues if you have any problems.
Other changes:
- Added NodeComplete processing to DialogueRunner, and exposed NodeCompleteResult to clients. When the end of a dialogue node is reached, your
DialogueUIBehaviourwill receive theNodeCompletemethod call. (pull request #31 - thanks to @thebeardphantom!) - Add a null check in Dialogue.Stop (fixes #29)
- Support colons in identifiers. (fixes #28)
v0.9.7.2
This is a quick bugfix release for 0.9.7, which was supposed to include a fix an issue caused by indenting an if statement further than its endif or else. This release actually does that. Whoops.
All the other goodness that's in 0.9.7 is still there and valid. Go wild!
v0.9.7
Note: there's a bug in this release! Go get v0.9.7.2 instead!
- Source Packages Now Available: Starting with this build, source code packages are now available. If you prefer to work with the source code instead of a compiled DLL, grab the source code package attached to this release.
- Fix a bug that caused parse errors if an
ifstatement'sendiforelsewas less indented than the initialif. - Added a command line flag to only do a parse stage, which is useful for testing.
- Correctly set the line number for
EndOfInputtokens, making certain error messages more useful. - Parse errors will now show the filename and node that contained the error.
- The locations of labels in nodes are now cached.
- Attempting to load the same node twice should now fail.
- Better automated testing.
v0.9.6
- Update example project's Unity version from 5.3.2f1 to 5.3.3f1
- New scripts to automate the creation of .unitypackage files.
- Compilation now happens when files are loaded. The
Compile()method inDialogueis now obsolete. - The string table now stores keys as strings, not ints. This is to help with localisation later.
- Shuffle options better. In particular, pairs of options should now shuffle properly. Fixes #22.
- No longer tries to show options when no options have been added [fixes #21].
- Commands can now begin with words that are similar to keywords like 'to', 'and', 'null', etc (fixes #20)
- Nodes tagged 'rawText' can have their source code accessed via the
Dialogueclass'sGetTextForNode()[closes #18] - Add a way to query the currently running node. Closes #19
- Attempting to continue a Dialogue that is waiting for an option to be selected now interrupts all execution.
[[NodeName]]now immediately jumps to a node, rather than using the 'options' system.- Handle the case of starting with a nonexistent node better.
v0.9.5
- The raw text of commands are now sent to the client, if they're not interpreted as function calls. Previously, they were split up by the tokeniser, and then joined back together with spaces; however, this breaks stuff like
<<doSomething +1>>, which was delivered to the client as "doSomething + 1" (note the extra space). - The
<<shuffleNextOptions>>command will cause the next set of options to be shuffled. - Calling
NodeExistsnow causes nodes to be compiled if they haven't been already.
v0.9.4
Parser
- Smileys should cause parse errors less often.
Unity integration:
- Added a method for loading Yarn code from a string.
- Remove use of 'WaitUntil', which created a dependency on Unity 5.3.2.
- Added a way to stop dialogue from Unity.
- Added a way to check if a node exists or not.
- Added a way to reset the DialogueRunner.
v0.9.3
v0.9.2
This release updates the architecture of Yarn Spinner to compile to bytecode. This doesn't change anything about how games use Yarn Spinner - it's entirely an internal change that will make it a lot easier to do some very cool stuff in the future.
We've also squashed several bugs, and generally made things more ship-shape.

