Problems displaying my quest in the QuestJournalUi component.

Announcements, support questions, and discussion for Quest Machine.
Post Reply
spokXXI
Posts: 2
Joined: Tue Sep 26, 2023 2:39 pm

Problems displaying my quest in the QuestJournalUi component.

Post by spokXXI »

Hey Tony,
unfortunately I have a problem with the implementation of quest machine.

The initial situation is:
- I have added the quest machine component to my scene
- created an empty component in the scene and gave it the QuestJournal script
- created a save system component in the quest machine component

All components with the following settings:
map_scene.png
map_scene.png (19.77 KiB) Viewed 5261 times
quest_machine_component.png
quest_machine_component.png (60.13 KiB) Viewed 5261 times
save_system_component.png
save_system_component.png (37.07 KiB) Viewed 5261 times
quest_journal_component.png
quest_journal_component.png (50.57 KiB) Viewed 5261 times

Process flow:
- i start a quest from my c# script

Code: Select all

PixelCrushers.MessageSystem.SendMessage(gameObject, questData[0], questData[1], questData[2]);
- then I change the scene and see that in the quest HUD component my quest is active (so far so well)
- but when I open the quest journal UI my quest is not entered

I open the journal with this line of code:

Code: Select all

private void Start()
	{
            GameObject questController = GameControllerUtils.FindGameObjectByName(controllerSpace, "QuestController");
            questJournal = questController.GetComponent<QuestJournal>();
        }

        public void Click1()
        {
            questJournal.ToggleJournalUI();
}
quest_state_in_new_scene.png
quest_state_in_new_scene.png (12.28 KiB) Viewed 5261 times
quest_HUD_state.png
quest_HUD_state.png (15.73 KiB) Viewed 5261 times
quest_journal_state.png
quest_journal_state.png (59.97 KiB) Viewed 5261 times
debug_log_messages.png
debug_log_messages.png (79.86 KiB) Viewed 5261 times

I've been sitting on this problem for a few days now without finding out why my quest is not entered in the quest journal UI, did I miss something?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems displaying my quest in the QuestJournalUi component.

Post by Tony Li »

Hi,

Would it be possible for you to back up your project, make sure the backup is good, and then update to the current Quest Machine version?

(Note: If you are using Position Saver components with NavMeshAgents, after updating to QM 1.2.40 or higher, tick the Welcome Window's USE_NAVMESH checkbox.)

If the problem still occurs, post another screenshot of the error -- or click on the error in the Console, press Ctrl+C to copy its details to the clipboard, and paste them here.
spokXXI
Posts: 2
Joined: Tue Sep 26, 2023 2:39 pm

Re: Problems displaying my quest in the QuestJournalUi component.

Post by spokXXI »

hi Tony,

I tried as you described, but the same error is displayed. However, now the quest HUD does not show anything either... :(

Code: Select all

MissingReferenceException: The object of type 'QuestJournal' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Component.GetComponentInChildren (System.Type t, System.Boolean includeInactive) (at <6a104889781c465ca00c12d0953583e2>:0)
UnityEngine.Component.GetComponentInChildren[T] () (at <6a104889781c465ca00c12d0953583e2>:0)
PixelCrushers.QuestMachine.IdentifiableQuestListContainer.get_questEntity () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest MonoBehaviours/Quest List/IdentifiableQuestListContainer.cs:99)
PixelCrushers.QuestMachine.IdentifiableQuestListContainer.get_image () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest MonoBehaviours/Quest List/IdentifiableQuestListContainer.cs:91)
PixelCrushers.QuestMachine.UnityUIQuestJournalUI.RefreshHeading () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest UIs/Unity UI/Unity UI Quest Journal UI/UnityUIQuestJournalUI.cs:447)
PixelCrushers.QuestMachine.UnityUIQuestJournalUI.RefreshNow () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest UIs/Unity UI/Unity UI Quest Journal UI/UnityUIQuestJournalUI.cs:430)
PixelCrushers.QuestMachine.UnityUIQuestJournalUI+<RefreshAtEndOfFrame>d__153.MoveNext () (at Assets/Plugins/Pixel Crushers/Quest Machine/Scripts/Quest UIs/Unity UI/Unity UI Quest Journal UI/UnityUIQuestJournalUI.cs:422)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <6a104889781c465ca00c12d0953583e2>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems displaying my quest in the QuestJournalUi component.

Post by Tony Li »

Hi,

I think this is happening:

1. Something triggers the quest journal to show or refresh the UI.

2. The quest journal starts the process. It waits until the end of the frame in case other messages also tell the quest journal to show/refresh the UI. This way it will only repaint the UI once instead of multiple times in the same frame.

3. Before the end of the frame, something is causing the quest journal to be destroyed.

If that info doesn't help you identify the issue, would it be possible for you to send a reproduction project to tony (at) pixelcrushers.com?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems displaying my quest in the QuestJournalUi component.

Post by Tony Li »

Hi Alex,

Thanks for putting together the reproduction project. I replied to your email with a question.
Post Reply