Automatic toggle quest when questname focused
Automatic toggle quest when questname focused
I also see there are groups on UI, with active and completed quests, but in game there are no groups showed, just quest list like above, is this correct?
Re: Automatic toggle quest when questname focused
Hi,
Inspect your Quest Journal UI's Unity UI Quest Journal UI component. Tick "Show Details On Focus".
Inspect your quest in the Quest Editor, and set the Group field of your quest's main info.
Re: Automatic toggle quest when questname focused
1. I have an error. First I have Quest Machine on first scene, on second scene I have Quest Journal UI, and on third scene I have Player. When I open Quest Journal UI on third scene, this error pop ups:
I noticed Player Quest Journal is not assigned to UI, I just have this script attached to Quest Journal UI Tab:
Error stops pop up when I take Quest from NPC, then also journal is assigned atutomatically to Journal UI.
2. How to show quest groups even if there is no quests yet?
3. How to move quests between those groups, from active to completed etc.
4. There is also any problem with navigation.
first selected is: Active Quest, and when I press down button it goes to Main Quests and when I press down to Diamond Quest, when I go up by press up button, Exploration quest is also skipped.
Code: Select all
NullReferenceException: Object reference not set to an instance of an object
PixelCrushers.QuestMachine.UnityUIQuestJournalUI.GetGroupNames (System.Collections.Generic.List`1[System.String]& groupNames, System.Int32& numGroupless) (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest UIs/Unity UI/Unity UI Quest Journal UI/UnityUIQuestJournalUI.cs:444)
PixelCrushers.QuestMachine.UnityUIQuestJournalUI.RefreshNow () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest UIs/Unity UI/Unity UI Quest Journal UI/UnityUIQuestJournalUI.cs:424)
PixelCrushers.QuestMachine.UnityUIQuestJournalUI+<RefreshAtEndOfFrame>d__147.MoveNext () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest UIs/Unity UI/Unity UI Quest Journal UI/UnityUIQuestJournalUI.cs:412)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <c6b52566f59b49fc861a7812a1ea2f6b>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Code: Select all
using PixelCrushers.QuestMachine;
using UnityEngine;
public class QuestJournalTab : MonoBehaviour
{
[SerializeField] private UnityUIQuestJournalUI unityUIQuestJournalUI;
private void Start() => QuestMachine.defaultQuestJournalUI = unityUIQuestJournalUI;
private void OnEnable() => unityUIQuestJournalUI.Repaint();
}
2. How to show quest groups even if there is no quests yet?
3. How to move quests between those groups, from active to completed etc.
4. There is also any problem with navigation.
first selected is: Active Quest, and when I press down button it goes to Main Quests and when I press down to Diamond Quest, when I go up by press up button, Exploration quest is also skipped.
- Attachments
-
- Bez tytułu.png (150.17 KiB) Viewed 739 times
Re: Automatic toggle quest when questname focused
Hi,
Do not call the UnityUIQuestJournalUI's Repaint() or Open() methods. The journal UI will not know whose Quest Journal to show. (Quest Machine lets you have multiple Quest Journals -- for example, for multiplayer games or for NPCs that can complete their own quests.) Instead, call the QuestJournal's ShowJournalUI() or ToggleJournalUI() method as instructed in the article above.
Please use this article to put the journal UI in a tab of your own UI: How To: Put Journal UI In Your Own Menu.qest43 wrote: ↑Sun Nov 13, 2022 1:00 pm1. I have an error. First I have Quest Machine on first scene, on second scene I have Quest Journal UI, and on third scene I have Player. When I open Quest Journal UI on third scene, this error pop ups:
Code: Select all
NullReferenceException: Object reference not set to an instance of an object...
Do not call the UnityUIQuestJournalUI's Repaint() or Open() methods. The journal UI will not know whose Quest Journal to show. (Quest Machine lets you have multiple Quest Journals -- for example, for multiplayer games or for NPCs that can complete their own quests.) Instead, call the QuestJournal's ShowJournalUI() or ToggleJournalUI() method as instructed in the article above.
You will have to use a custom subclass of UnityUIQuestJournalUI.
You can show active quests separately from completed quests, but for handwritten quests (i.e., quests made in the Quest Editor window), you can't easily change their groups.
By default, the quest journal UI uses Unity UI's Automatic navigation. Check the Navigation dropdowns on your Quest Group Template, Active Quest Name Template, and Completed Quest Name Template. Also compare it to the example Quest Journal UI that ships with Quest Machine. I just confirmed that navigation works correctly in the Demo. (I set the Knight's Quest Group to "Hunting" to make sure that there were two quest groups if I picked up the Villager's an Knight's quests.)