Need Help with Synchronization and Updating of Item and Quest Data in Dialog System for Unity with SQLite

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
cronox
Posts: 1
Joined: Thu Jun 08, 2023 6:26 pm

Need Help with Synchronization and Updating of Item and Quest Data in Dialog System for Unity with SQLite

Post by cronox »

Hello everyone,

I'm currently working on integrating an SQLite database (or any SQL database) with the Dialog System for Unity plugin for my game. While I've successfully established a connection to the SQLite database and retrieved item and quest data, I'm facing challenges with the synchronization, adding, and updating of this data for use in the Dialog System for Unity plugin. :roll:

Specifically, I'm looking for guidance and assistance in:
  • Implementing a mechanism to synchronize and update item and quest data between the SQLite database and the Dialog System for Unity plugin.
  • Managing changes to items and quests in the database and reflecting those changes in the Dialog System for Unity.
  • Handling additions, modifications, and deletions of items and quests within the database and ensuring that these changes are properly reflected in the game.
If anyone has experience with handling the synchronization and updating of data between an SQLite database and the Dialog System for Unity plugin, I would greatly appreciate your insights and advice. I'm particularly interested in any recommended approaches, best practices, or code examples that can help me tackle this challenge effectively. :D

Thank you in advance for your assistance and expertise. I look forward to learning from your experiences and finding a solution to this synchronization issue. :mrgreen:

Best regards,

Cronox
User avatar
Tony Li
Posts: 22130
Joined: Thu Jul 18, 2013 1:27 pm

Re: Need Help with Synchronization and Updating of Item and Quest Data in Dialog System for Unity with SQLite

Post by Tony Li »

Hi,

The QuestLog class has several override delegates that you can hook into, such as QuestLog.SetQuestStateOverride. You could assign a method that calls QuestLog.DefaultSetQuestState() and also sends the state to your SQLite database.

Alternatively, the Dialogue System provides several special script methods such as OnQuestStateChange(questName) that you can use to be notified of events and update the SQLite database.

Going in the other direction, when you make changes to your SQLite database you can use the QuestLog class to update quest states or the DialogueLua.SetItemField() method to update item info.

Alternatively, you could write C# methods to work with the items in your SQLite database and register them with Lua so your conversations can directly access your SQLite database.
Post Reply