Preserving Yarn Tags and Metadata Post-Import

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
KenCrim
Posts: 4
Joined: Wed Aug 21, 2024 2:02 pm

Preserving Yarn Tags and Metadata Post-Import

Post by KenCrim »

Hello! We're using the dialogue system with YarnSpinner, and have had a great time so far. We're wondering what the most straightforward way would be to access metadata and tags defined within yarn files: https://docs.yarnspinner.dev/getting-st ... s-metadata. Is that supported today in the importer, and is there perhaps something config-level that we're missing? If not, any recommendations for where to jerry-rig it?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Preserving Yarn Tags and Metadata Post-Import

Post by Tony Li »

Hi,

The Dialogue System Extras page has a patch (direct download) that stores #hashtag metadata in a field named "Metadata" in the corresponding dialogue entry. If the line has more than one hashtag, they'll all be in the field, separated by semicolons (;).

This update will also be in v2.2.48.
KenCrim
Posts: 4
Joined: Wed Aug 21, 2024 2:02 pm

Re: Preserving Yarn Tags and Metadata Post-Import

Post by KenCrim »

Awesome!! Thank you so much for the quick response.
KenCrim
Posts: 4
Joined: Wed Aug 21, 2024 2:02 pm

Re: Preserving Yarn Tags and Metadata Post-Import

Post by KenCrim »

Actually - sorry- one last question: I know this is probably a longshot, given that these files are getting munched before runtime, but is there currently any way to preserve yarn-defined custom markup tags, a la:

NPC: I'm totally innocent! [secret result={$secretResult}]He is not totally innocent[/secret]

Or would this be the sort of functionality that we'd need to handle ourselves via inline Lua calls or message interceptors?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Preserving Yarn Tags and Metadata Post-Import

Post by Tony Li »

Hi,

If you add a YarnCustomCommands component (or subclass) to your Dialogue Manager, it will parse custom markup in its OnConversationLine(Subtitle) method. You can override the behavior in a subclass if you want.
KenCrim
Posts: 4
Joined: Wed Aug 21, 2024 2:02 pm

Re: Preserving Yarn Tags and Metadata Post-Import

Post by KenCrim »

Awesome, exactly what I was looking for. Thank you!
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Preserving Yarn Tags and Metadata Post-Import

Post by Tony Li »

Glad to help!

I recommend writing a small test yarn file to test all of the features you intend to use, or at least the ones you can think of at the moment. This way you'll know how they work in the Dialogue System and can plan accordingly (or make a feature request if necessary).
Post Reply