Hello!
I am trying to create a script that connects third-party level editor (LDtk) and Dialogue System.
My goal is to do this:
1. write dialogueTitle string values in the level editor, for each trigger.
2. Set DIalogueSystemTrigger component's conversation field with each trigger's dialogueTitle value.
3. Call DialogueSystemTrigger with OnUse() in runtime.
while writing a script for this, I want do a safety check if the dialogueTitle is valid conversation title in the database, to make the script safe.
How should I check if my database has the conversation title?
Can you lend me some help please?
Regards.
How to check if my database has a certain string as 'title'
Re: How to check if my database has a certain string as 'title'
Hi,
If you want to check at runtime:
If you're using an editor script, you'll need a reference to the DialogueDatabase asset (e.g., "database" below):
If you want to check at runtime:
Code: Select all
bool doesConversationExist = DialogueManager.masterDatabase.GetConversation("your title") != null;
Code: Select all
bool doesConversationExist = database.GetConversation("your title") != null;
Re: How to check if my database has a certain string as 'title'
Works like a charm! Thanks for the help 
Have a good day, Tony!

Have a good day, Tony!
Re: How to check if my database has a certain string as 'title'
Happy to help! Have a good day!