Page 1 of 1

conversations from database

Posted: Thu Jul 07, 2016 1:35 pm
by jonodubs
hi, great plugin :)

just wondering is it possible to pull conversations/quest info from a database (e.g. local sqlite)?

Re: conversations from database

Posted: Thu Jul 07, 2016 7:26 pm
by Tony Li
Hi,

Thanks!

Yes, you can do that. Put your conversations and quests in a dialogue database, and export it as a Chat Mapper XML text file. Then store the text in your SQLite database. To pull it, retrieve the text from the SQLite database and use ChatMapperProject.Load(filename).ToDialogueDatabase() to convert it back into a dialogue database. Then use DialogueManager.AddDatabase() to add it to the runtime environment. This post has more details.

As another option, you can serialize your dialogue database directly to a string using JsonUtility and store that string in your SQLite database. Then, after pulling it back from SQLite, use JsonUtility to deserialize it back into a dialogue database. This is an alternative to converting it to Chat Mapper XML format.

If you only need to add quests, you can add them individually at runtime using QuestLog.AddQuest().

The Dialogue System also supports asset bundles. You can put dialogue databases and other assets such as voiceover files in them, and load them at runtime.