Auto Show Alert

Announcements, support questions, and discussion for the Dialogue System.
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Auto Show Alert

Post by mandi »

Hello Tony,
I am considering adding a piece of code that would automatically display alerts when a quest is completed, and I have 2 questions:
1. Where to start?
2. I realized that many quests I have set up already have in their triggers Show Alert section used - is it somehow possible to avoid show alert duplication, or would I have to manually delete all those sections from all the triggers?

Thank you in advance,
Best!
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Auto Show Alert

Post by mandi »

I guess I would have to implement a simple queue for that anyway, just in case my character finishes more than 1 quest at a time - is there some method that would enable me to yield Show Alert execution until the currently displayed alert is showing?
Best!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Auto Show Alert

Post by Tony Li »

Hi Artur,

If you're using Unity UI, inspect your dialogue UI and tick Alert > Queue Alerts. This will show alerts in sequence.

You can add a script to the Dialogue Manager (or a child GameObject) that has an OnQuestStateChange(questName) method. Maybe something like this:

Code: Select all

void OnQuestStateChange(string questName) {
    if (QuestLog.IsQuestSuccessful(questName)) {
        DialogueManager.ShowAlert("Quest Completed: " + QuestLog.GetQuestTitle(questName));
    }
} 
I'm afraid you'll have to remove the same alert messages from your existing triggers.
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Auto Show Alert

Post by mandi »

Tony,
thank you very much! Much appreciate the alert queue!
Best!
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Auto Show Alert

Post by mandi »

Are there callbacks for quest entry state changes? I want to implement the similar on the quest entry level.
Best!
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Auto Show Alert

Post by mandi »

Do those messages work only if I use SetQuestState() method in my dialogues? I have lots of assignments like Quest["Acquaint_Voxel_Vlad"].State = "active".
BTW, how to convert checks like Quest["Acquaint_Voxel_Vlad"].State ~= "success" ?

Best!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Auto Show Alert

Post by Tony Li »

Hi Artur,
mandi wrote:Are there callbacks for quest entry state changes? I want to implement the similar on the quest entry level.
It's the same callback. The Dialogue System sends "OnQuestStateChange" if a quest state changes or a quest entry state changes.
mandi wrote:Do those messages work only if I use SetQuestState() method in my dialogues? I have lots of assignments like Quest["Acquaint_Voxel_Vlad"].State = "active".
I'm afraid those messages require SetQuestState(). This is one of the reasons I added SetQuestState(). I realized that it would be handy to do extra things when setting a quest state, such as automatically updating the quest tracker HUD and sending the message. Recent versions of the Dialogue System have a search bar in nodes or outline mode. You could use it to search for "Quest[" in each conversation and manually change it to SetQuestState() or CurrentQuestState(). Or you could export the database to CSV and do the searching in a text editor or Excel. Sorry about the manual work. If you have a lot of these, let me know. I might be able to put together an editor utility to automatically convert them.
mandi wrote:BTW, how to convert checks like Quest["Acquaint_Voxel_Vlad"].State ~= "success" ?
You could manually change them to:

Code: Select all

CurrentQuestState("Acquaint Voxel Vlad") ~= "success"
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Auto Show Alert

Post by mandi »

Hi Tony,
yes, I've got lots of these, actually all my levels so far are set up using this obsolete way. If you could make a simplest kind of a replacer tool, I would be very grateful. The good thing here is I now know why sometimes my on quest completed animations were not triggered ;)
Best!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Auto Show Alert

Post by Tony Li »

Will do! It might take a day or two. I'll post it here when it's ready.
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Auto Show Alert

Post by mandi »

Wow, you are my hero Tony!
Post Reply