Page 1 of 1

Update/Add Dialogue Database On The Fly

Posted: Tue May 15, 2018 5:50 pm
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?

Re: Update/Add Dialogue Database On The Fly

Posted: Tue May 15, 2018 9:06 pm
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

Re: Update/Add Dialogue Database On The Fly

Posted: Wed May 16, 2018 1:31 pm
by ljx00_520
Thanks for the pointers, Tony. It saves me a lot of time for researching!

Re: Update/Add Dialogue Database On The Fly

Posted: Wed May 16, 2018 1:46 pm
by Tony Li
Glad to help!