Page 1 of 1

Capturing failed conversation request?

Posted: Tue Aug 15, 2023 6:19 pm
by LilGames
Do you have a recommended or built-in way to capture a failed attempt to start a conversation? (Let's say the conversation doesn't exist in the database)

eg:
DialogueManager.StartConversation("no_such_conversation");

Right now it's an exception. Should I wrap the call in try-catch?

Re: Capturing failed conversation request?

Posted: Tue Aug 15, 2023 7:03 pm
by Tony Li
Hi,

It's not an actual exception; it's just a Debug.LogWarning() message.

You could check if a conversation is active:

Code: Select all

DialogueManager.StartConversation("no_such_conversation");
if (!DialogueManager.isConversationActive) Debug.Log("Failed to start conversation");
Or you could check if the conversation exists first:

Code: Select all

if (DialogueManager.masterDatabase.GetConversation("no_such_conversation"))
{
    DialogueManager.StartConversation("no_such_conversation");
}

Re: Capturing failed conversation request?

Posted: Wed Aug 16, 2023 11:24 am
by LilGames
You always have a solution! Awesome!