Automatic toggle quest when questname focused

Announcements, support questions, and discussion for Quest Machine.
Post Reply
qest43
Posts: 33
Joined: Thu May 26, 2022 9:22 am

Automatic toggle quest when questname focused

Post by qest43 »

Bez tytułu.png
Bez tytułu.png (121.42 KiB) Viewed 755 times
Hey, now when I want to open quest information on the right side of panel, I have to click enter, how can I toggle this info when quest name is focused without need to toggle it by enter key?

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?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Automatic toggle quest when questname focused

Post by Tony Li »

Hi,
qest43 wrote: Sat Nov 12, 2022 3:37 pmHey, now when I want to open quest information on the right side of panel, I have to click enter, how can I toggle this info when quest name is focused without need to toggle it by enter key?
Inspect your Quest Journal UI's Unity UI Quest Journal UI component. Tick "Show Details On Focus".
qest43 wrote: Sat Nov 12, 2022 3:37 pmI 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?
Inspect your quest in the Quest Editor, and set the Group field of your quest's main info.
qest43
Posts: 33
Joined: Thu May 26, 2022 9:22 am

Re: Automatic toggle quest when questname focused

Post by qest43 »

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:

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&)
I noticed Player Quest Journal is not assigned to UI, I just have this script attached to Quest Journal UI Tab:

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();
}
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.
Attachments
Bez tytułu.png
Bez tytułu.png (150.17 KiB) Viewed 737 times
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Automatic toggle quest when questname focused

Post by Tony Li »

Hi,
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...
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.

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.
qest43 wrote: Sun Nov 13, 2022 1:00 pm2. How to show quest groups even if there is no quests yet?
You will have to use a custom subclass of UnityUIQuestJournalUI.
qest43 wrote: Sun Nov 13, 2022 1:00 pm3. How to move quests between those groups, from active to completed etc.
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.
qest43 wrote: Sun Nov 13, 2022 1:00 pm4. 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.
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.)
Post Reply