Description
Resolves {prefix.key} tokens in dialogue text at runtime. Parses text for token patterns, looks up the appropriate resolver by prefix, and returns the resolved string. Unresolved tokens remain in the text unchanged and produce a warning log.
ITextTokenService
Interface
Public Methods
| Name | Parameters | Return Type | Description |
|---|
| Resolve | string text, TokenResolutionContext context | string | Resolves all tokens in the text and returns the result. |
ITokenResolver
Interface
Properties
| Name | Type | Description |
|---|
| Prefix | string | The namespace prefix this resolver owns. |
Public Methods
| Name | Parameters | Return Type | Description |
|---|
| TryResolve | string key, TokenResolutionContext context, out string value | bool | Attempts to resolve the key. Returns true if successful. |
Built-in Resolvers
| Resolver | Prefix | Keys |
|---|
| BlackboardTokenResolver | bb | Any blackboard key; prefix with conversation. for conversation scope |
| ParticipantTokenResolver | speaker | name |
| ParticipantTokenResolver | other | name |
| WorldTokenResolver | world | time, day, period |
TokenResolutionContext
| Name | Type | Description |
|---|
| Participants | DialogueParticipants | The current speaker and listener. |
| NodeId | string | The ID of the current dialogue node. |