Update/Add Dialogue Database On The Fly

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ljx00_520
Posts: 2
Joined: Tue May 15, 2018 5:44 pm

Update/Add Dialogue Database On The Fly

Post by ljx00_520 »

Hi Tony,

As the title said, is it possible to update or add dialogue database on the fly? E.g. calling a web API to retrieve new content and put it into local dialogue database. If yes, could you point me to a proper tutorial or hints?

Thanks for any insights. :D :D

PS: The same question to Quest Machine system as well? Is it possible to add hand written quest through web API call to local quest database?
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Update/Add Dialogue Database On The Fly

Post by Tony Li »

Hi,
ljx00_520 wrote: Tue May 15, 2018 5:50 pmAs the title said, is it possible to update or add dialogue database on the fly? E.g. calling a web API to retrieve new content and put it into local dialogue database. If yes, could you point me to a proper tutorial or hints?
Yes. You have your choice of ways. Here are a few:

1. Put the content in Chat Mapper XML format. You can export this format from the Dialogue Editor window (or from Chat Mapper of course). Then follow these instructions to load at runtime: How to Import Chat Mapper at Runtime.

2. Or do the same with articy:draft XML format as described here: articy:draft Runtime Conversion. You have to export this from articy:draft; you can't export from the Dialogue Editor window to articy:draft XML format.

3. Or do the same with JSON as described in this post.

4. Or you can create the database in a script as described in this post.
ljx00_520 wrote: Tue May 15, 2018 5:50 pmPS: The same question to Quest Machine system as well? Is it possible to add hand written quest through web API call to local quest database?
Yes again. :-) Here are a couple ways:

1. Put the content is JSON format like this:

Code: Select all

var serializableProxy =  new QuestProxy(myQuest);
var json = JsonUtility.ToJson(serializableProxy);
and convert JSON back into a quest like this:

Code: Select all

var serializableProxy = JsonUtility.FromJson<QuestProxy>(json);
var quest = ScriptableObject.CreateInstance<Quest>();
questProxy.CopyTo(quest);
2. Or create quests in a script as described in this post: Script Driven Quests
ljx00_520
Posts: 2
Joined: Tue May 15, 2018 5:44 pm

Re: Update/Add Dialogue Database On The Fly

Post by ljx00_520 »

Thanks for the pointers, Tony. It saves me a lot of time for researching!
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Update/Add Dialogue Database On The Fly

Post by Tony Li »

Glad to help!
Post Reply