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).

YarnPromise

A completion object for the presenter system.
class_name YarnPromise
extends RefCounted

Inherits from RefCounted

Raw signals are broadcasts: one that fires while nobody is awaiting it is lost, and awaiting it after the fact hangs. A promise reembers being settled, so wait resumes immediately when called on an already-settled promise, and completion can never be lost to ordering. This is Paris' GDScript stand-in for an awaitable task! Idempotent (thanks, Tim): only the first settle wins, later calls are no-ops. The dialogue runner uses one promise per presenter per piece of content ("this presenter has finished this line"), and a shared promise for option selection ("the first valid selection wins").

#Properties

#is_settled

var is_settled: bool = false

Type bool

#value

var value: Variant = null

Type Variant

#Signals

#completed

Fired on settlement carrying the settled value. Prefer wait over awaiting this directly.
signal completed(value: Variant)

Parameters

  • valueVariant

#Methods

#settle(Variant)

Settles the promise with result. First call wins; later calls are no-ops.
func settle(result: Variant = null) -> void

Parameters

  • resultVariant

#wait()

Awaitable: resumes when the promise settles immediately if it already has and returns the settled value.
func wait() -> Variant

Returns Variant

Generated from Yarn Spinner for Godot GDScript 3.3.