Reimporting Yarn 2 files into dialogue system

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
igiss
Posts: 4
Joined: Thu Aug 03, 2023 10:16 am

Reimporting Yarn 2 files into dialogue system

Post by igiss »

I've been working on a narrative-driven Unity project for some time, and been using yarn 2 for writing dialogue. However, now, as we started to integrate dialogues with quest system, it became clear that re-importing yarn files into project resets changes made to the dialogues within the Dialogue System, in the Dialogue Editor nodes.

For me, as a writer, this is bad news. I'd love to continue writing in yarn files, so I'm trying to figure out if it's possible to re-import yarn files, mainly the dialogue strings from them, so that nodes in the Dialogue Editor don't get messed up.

So, the simplest thing: I change the order of characters, Actor and Conversant, in the Editor. If I reimport the dialogue from yarn, the order changes back to what it was by default. Is there a way to re-import dialogue texts without messing with character order?

There are other examples, like a node that activates a certain function etc.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Reimporting Yarn 2 files into dialogue system

Post by Tony Li »

Hi,

When you import from yarn, it uses the yarn version for everything, except it retains variables you've defined in the Dialogue Editor. Ideally you'll edit your content in one place (yarn) instead of splitting it between two different places (yarn and Dialogue Editor). As a project gets to be medium to large in size, trying to maintain edits in multiple places will become a nightmare.

There should be ways to do everything you need to do in yarn using the features provided in the Yarn 2 importer. Is there anything you have a question about implementing through your yarn files?

Another feature you could take advantage of is to use multiple databases -- one for non-Yarn stuff, and one imported from yarn files. See: Working With Multiple Databases.
igiss
Posts: 4
Joined: Thu Aug 03, 2023 10:16 am

Re: Reimporting Yarn 2 files into dialogue system

Post by igiss »

Thanks. We eventually decided to import texts from Yarn once and later edit them in the Dialogue Editor. Unfortunately, supporting Yarn fuctions took more time to implmenet. Not the best option for me, but we'll have to deal with it.

It would really help if some tool existed that would allow to explort only the text strings out of the project, keeping a certain order, and then re-import them. I know that localization system should do something like that, but our project is country-specific and we don't have localization.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Reimporting Yarn 2 files into dialogue system

Post by Tony Li »

Do you want to export text strings from the dialogue database? If so, you can still use the Dialogue Editor's Localization Export/Import feature. Export to any language. It doesn't matter, since you won't be using the language's translations. This will produce a spreadsheet with one line of text per row. Each row will contain the original text and a column for the translation. Edit the original text column. Before reimporting in the Localization Export/Import section, tick the checkbox to the right of the language. This will tell the Dialogue System to update the original text from the spreadsheet's original text column.
Post Reply