Custom Quest Log

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Ramsdal
Posts: 10
Joined: Wed Oct 21, 2015 6:57 am

Custom Quest Log

Post by Ramsdal »

Hi Tony

I am considering if I want to make a custom Quest log view (in the style of wow, so quest titles on one side, and description on another side - like this: http://vignette1.wikia.nocookie.net/wow ... 0728174736).

I can see that the QuestLogWindow.ClickQuest is called and the description for this just says "Your GUI should call this when the player clicks on a quest to expand or close it.". Also all the examples is with the "accordion style", therefor before I begin to look at this I would like to know if it is possible and if you have a quick suggestion on what steps to take in order to make this.

The ClickQuest needs to be called still I assume, but in stead of expanding the relevant quest should be shown in the Description area. I guess this could be done manually within the "ClickQuestFoldout" method. What are your thoughts?

Also thanks for the awesome system ;)

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

Re: Custom Quest Log

Post by Tony Li »

Hi Peter,

Yes, this is fairly easy to implement. Games such as Tortured Hearts have done this by making a subclass of UnityUIQuestLogWindow. You could also make a subclass of the base abstract QuestLogWindow if you don't want to inherit all the Unity UI stuff in UnityUIQuestLogWindow.

You only need to override the OnQuestListUpdated() method. This method is called whenever the player clicks on a quest heading or abandons a quest. To get an idea of how it works, look at Scripts/Supplemental/UI/Quest Log Window/UnityUIQuestLogWindow.cs. It calls a new method AddQuestsToTable(), which loops through an array Quests[] defined in the base QuestLogWindow.

The string property SelectedQuest is set to the title of the currently-selected quest. As you're looping through Quests[], check if each item's title is equal to SelectedQuest. If so, draw its Description and Entries in the right-hand panel.

In the left-hand panel, make sure to set up your headings as buttons so they call ClickQuestFoldout(questTitle) when clicked. UnityUIQuestLogWindow does it by using this line of code:

Code: Select all

questHeadingButton.onClick.AddListener(() => ClickQuestFoldout(questInfo.Title));
Ramsdal
Posts: 10
Joined: Wed Oct 21, 2015 6:57 am

Re: Custom Quest Log

Post by Ramsdal »

Hi Tony

Thanks for the writeup, I will have a look at it and most likely try to implement my own design. If I encounter any large problems "I'll be back..." (yes I just watched terminator)..

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

Re: Custom Quest Log

Post by Tony Li »

Sounds good. I'm here, so if you get stuck on anything, don't hesitate to post here or email me at tony (at) pixelcrushers.com.
Post Reply