Animating the quest UI (and other UI things)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lostmushroom
Posts: 185
Joined: Mon Jul 01, 2019 1:21 pm

Animating the quest UI (and other UI things)

Post by lostmushroom »

Hey Tony. I'm looking into animating UI elements like quest tracks and speech bubbles, just wanted to check the best way of doing this.

I'm using the Basic Standard Quest Tracker HUD. Right now, the quest tracks just switch on and off when a quest becomes active. Is there a way to have them animate in and out? (Perhaps with different animations depending on whether you succeeded or failed?)

I know some of the other UI elements have Show and Hide animations, but I don't think there are any on the quest UI elements? Unless I'm missing them.

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

Re: Animating the quest UI (and other UI things)

Post by Tony Li »

Hi,

Speech bubbles are easy to animate. In fact, you can download the Feel + Text Animator + Dialogue System demo scene and use its animations as-is. We had a quality pass from Renaud of More Mountains (maker of Feel), who is an art designer, so the bubble has a good feel to it.

The StandardUIQuestTracker doesn't natively do any animation. You'll have to make a subclass and override RefreshAtEndOfFrame() and AddQuestTrack().

Alternatively, some devs use Animmal's Ultimate Notification System asset to show an animated notification when a quest becomes active. Animmal uses it themselves for The Way of Wrath, which uses the Dialogue System and Quest Machine.
lostmushroom
Posts: 185
Joined: Mon Jul 01, 2019 1:21 pm

Re: Animating the quest UI (and other UI things)

Post by lostmushroom »

Thanks Tony, that's really helpful. I'll try the subclass method (:
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animating the quest UI (and other UI things)

Post by Tony Li »

Glad to help! In your subclass I recommend keeping a list of all quests that are currently being shown. In AddTrack, check if the quest is in the list. Roughly, the idea would be:

Code: Select all

public class MyQuestTracker : StandardUIQuestTracker
{
    public List<string> alreadyShown = new List<string>();
    
    protected override void AddQuestTrack(string quest)
    {
        base.AddQuestTrack(quest);
        if (!alreadyShown.Contains(quest))
        {
            alreadyShown.Add(quest);
            var questTrack = container.GetChild(container.childCount - 1).GetComponent<StandardUIQuestTrackTemplate>();
            questTrack.GetComponent<Animator>().Trigger("Pop In"); // Animate a pop-in effect.
        }
    }
}
Post Reply