Page 1 of 1

Preserving Yarn Tags and Metadata Post-Import

Posted: Wed Aug 21, 2024 2:14 pm
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?

Re: Preserving Yarn Tags and Metadata Post-Import

Posted: Wed Aug 21, 2024 4:14 pm
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.

Re: Preserving Yarn Tags and Metadata Post-Import

Posted: Wed Aug 21, 2024 4:22 pm
by KenCrim
Awesome!! Thank you so much for the quick response.

Re: Preserving Yarn Tags and Metadata Post-Import

Posted: Wed Aug 21, 2024 5:35 pm
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?

Re: Preserving Yarn Tags and Metadata Post-Import

Posted: Wed Aug 21, 2024 8:50 pm
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.

Re: Preserving Yarn Tags and Metadata Post-Import

Posted: Wed Aug 21, 2024 11:17 pm
by KenCrim
Awesome, exactly what I was looking for. Thank you!

Re: Preserving Yarn Tags and Metadata Post-Import

Posted: Thu Aug 22, 2024 8:13 am
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).