Is there a way to apply template to all existing dialogue entries?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
hellwalker
Posts: 112
Joined: Tue Jan 19, 2016 11:37 pm

Is there a way to apply template to all existing dialogue entries?

Post by hellwalker »

Hey,

So I have existing large dialogue database. And now i have to add localization to it, so I added template fields for dialogue template. I know you can click on template button on dialogue node to apply the missing fields like localization, but I was wondering if there is some way to add it to all the existing nodes, without overwriting the custom fields I added to some nodes? Actually even if thats not possible, it's easier for me to apply custom nodes again, then to go through everything and click template button. So even if I can add it in external file like .csv and import back that would be good.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Is there a way to apply template to all existing dialogue entries?

Post by Tony Li »

On the Templates page, there is a terribly-named menu item "Update From Assets". (Your post finally reminded me to rename this menu item to something clearer in the next release.) This menu item does two things:

1. Updates the templates with any custom fields defined in any assets in the database, and

2. Applies that template to all assets, adding any missing fields but not overwriting existing data.

Will that accomplish what you need? (Make a backup of your database just in case my explanation wasn't clear and it's not what you need.)
hellwalker
Posts: 112
Joined: Tue Jan 19, 2016 11:37 pm

Re: Is there a way to apply template to all existing dialogue entries?

Post by hellwalker »

That is a bit different. I need variation of that, which will not copy custom fields to all other nodes.
To give example:

I'm using dialogue panel switch mid game extension from Dialogue manager extras. So on some nodes I have something like
PC Panel
NPC Panel
Response Panel

and this switches dialogue from normal one to mobile phone chat style one.

I also recently added localization fields to Dialogue Template.

If I click Update From Assets now, Both Localization fields from template and the panel switcher fields get added to everything. What I need is to only add localization fields to everything.

It would be helpful if you could split that function into two:
1)Add missing template fields to all assets
2)Share any custom fields to all other assets
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Is there a way to apply template to all existing dialogue entries?

Post by Tony Li »

Will do! I'll try to make a patch available by the end of the weekend. If you don't already have access to the Pixel Crushers customer download site, please PM me your Unity Asset Store invoice number so I can set it up for you.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Is there a way to apply template to all existing dialogue entries?

Post by Tony Li »

The patch is now available on the Pixel Crushers customer download site. There are now three separate menu items:
  • Update Template From Assets
  • Apply Template To Assets
  • Sync Assets and Template (which applies both of the above)
hellwalker
Posts: 112
Joined: Tue Jan 19, 2016 11:37 pm

Re: Is there a way to apply template to all existing dialogue entries?

Post by hellwalker »

Image
Thank you very much. This is great!
Post Reply