Page 1 of 1

Show Last Quest Details On Open?

Posted: Wed Sep 23, 2020 2:30 pm
by jlhacode
Hi, I was wondering if there was a simple way to implement something similar to the Show First Quest Details On Open but showing the opposite instead.


Code: Select all

        protected virtual Quest GetFirstQuest()
        {
            var hasQuest = (questJournal != null && questJournal.questList != null && questJournal.questList.Count > 0);
            return hasQuest ? questJournal.questList[0] : null;
        }
I figured I would have to extend UnityUIQuestJournalUI and create a similar function to GetFirstQuest(). Simply enough, I replace the 0 in the questList array lookup with a questList.Count - 1 and call it in the override Show(QuestJournal) method.

The issue I'm running into is that I can't add my Quest Journal UI prefab to my QuestMachineConfiguration component for some reason. In fact, I can't remove and re-add the Quest Journal UI object even if I don't change the gameobject/prefab at all. This may be caused a hole in my understanding of Unity.

Re: Show Last Quest Details On Open?

Posted: Wed Sep 23, 2020 4:55 pm
by Tony Li
Please see page 46 of the Quest Machine manual. Because that field uses a C# interface, you have to drag the specific component into the field to assign it.