Hi again!
I'm wondering if it is possible to show a specific quest entry in a UI window.
I've looked over the Basic Standard UI Quest Log prefab, which loads a list of all quests dynamically, but I'd like to create an alternate UI menu to display a specific quest entry (or small group of specific quest entries I can call by name) in a specific order in the design.
So essentially I'd need a way to call a specific quest's name/description/etc and display that in a UI panel.
Would this be terribly complicated to do?
Below is an example of something I am trying to achieve. (Quests are displayed as icons, and quest information is displayed in the box when the user mouses over the icon)
How to show specific Quest entry in UI
Re: How to show specific Quest entry in UI
Hi,
You can do a lot with the existing StandardUIQuestLogWindow script. Here's a quick and dirty rendition using the Basic Standard Quest Log Window prefab, just moving some UI elements around and changing their appearance:
CouncilUExample_2019-11-02.unitypackage
It looks like this:
The important methods are virtual so you can override their behavior to change things up as necessary. For example, you might want to keep the quest details panel hidden except for when the player is mousing over a quest title.
If you want to write your own script instead, use the QuestLog class.
Some examples:
You can do a lot with the existing StandardUIQuestLogWindow script. Here's a quick and dirty rendition using the Basic Standard Quest Log Window prefab, just moving some UI elements around and changing their appearance:
CouncilUExample_2019-11-02.unitypackage
It looks like this:
The important methods are virtual so you can override their behavior to change things up as necessary. For example, you might want to keep the quest details panel hidden except for when the player is mousing over a quest title.
If you want to write your own script instead, use the QuestLog class.
Some examples:
Code: Select all
using PixelCrushers.DialogueSystem;
// Get a list of all active quests:
string[] questNames = QuestLog.GetAllQuests(QuestState.Active);
// Get a quest's title and description (localization-aware, based on the current language):
string title = QuestLog.GetQuestTitle("Ur-nammu");
string description = QuestLog.GetQuestDescription("Ur-nammu");
-
- Posts: 32
- Joined: Wed Nov 14, 2018 8:27 pm
How to show specific Quest entry in UI
Thank you for the example!
So I should be editing the StandardQuestLogWindow.cs to manipulate it how I want?
I'll have to dig into it to truly undestand how it works.
I found this part of the script that I THINK is what makes details appear on mouse over, so if so - would I just add an PointerExit after this bit? Is there a HideDetailsOnSelect?
Sorry, I have just been having trouble wrapping my head around this code in particular. I managed to customize all my other UI no problem, but this one is giving me more issues.
So I should be editing the StandardQuestLogWindow.cs to manipulate it how I want?
I'll have to dig into it to truly undestand how it works.
This is exactly what I'd like to do. Just hover over each quest title to see the details.
I found this part of the script that I THINK is what makes details appear on mouse over, so if so - would I just add an PointerExit after this bit? Is there a HideDetailsOnSelect?
Code: Select all
// On cursor hover:
entry = new UnityEngine.EventSystems.EventTrigger.Entry();
entry.eventID = UnityEngine.EventSystems.EventTriggerType.PointerEnter;
entry.callback.AddListener((eventData) => { ShowDetailsOnSelect(target); });
eventTrigger.triggers.Add(entry);
Re: How to show specific Quest entry in UI
Now that I think about it, that doesn't need any code. Here's an updated example:
CouncilUExample2_2019-11-02.unitypackage
It's the same as the previous one except I added these events:
1. On the StandardUIQuestLogWindow component:
2. On the Active Quests Button and Completed Quests Button GameObjects:
These events keep the details panel hidden unless the player is mousing over an Active Quest Button or Completed Quest Button.
CouncilUExample2_2019-11-02.unitypackage
It's the same as the previous one except I added these events:
1. On the StandardUIQuestLogWindow component:
2. On the Active Quests Button and Completed Quests Button GameObjects:
These events keep the details panel hidden unless the player is mousing over an Active Quest Button or Completed Quest Button.
-
- Posts: 32
- Joined: Wed Nov 14, 2018 8:27 pm
Re: How to show specific Quest entry in UI
Thanks Tony!
I can work with this
I can work with this
Re: How to show specific Quest entry in UI
Great! If you have questions about implementing any other features, just let me know.