Page 1 of 1

problem opening and closing quest log window

Posted: Thu Oct 01, 2015 10:49 am
by Arcanor
I'm just starting to try out the quest log window, and having some success. I've created a button in my UI that alternately calls Open() or ClickCloseButton() on a reference to a "Generic Unity UI Quest Log Window" in my scene, depending on if it "IsOpen" or not. This works a few times, just fine, but if I open and close the window a few times quickly in succession, I get the following error:

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
PixelCrushers.DialogueSystem.UnityUIQuestLogWindow.AddQuestToTable (PixelCrushers.DialogueSystem.QuestInfo questInfo, Int32 questIndex) (at Assets/Dialogue System/Scripts/Supplemental/UI/Quest Log Window/UnityUIQuestLogWindow.cs:239)
PixelCrushers.DialogueSystem.UnityUIQuestLogWindow.AddQuestsToTable () (at Assets/Dialogue System/Scripts/Supplemental/UI/Quest Log Window/UnityUIQuestLogWindow.cs:215)
PixelCrushers.DialogueSystem.UnityUIQuestLogWindow.OnQuestListUpdated () (at Assets/Dialogue System/Scripts/Supplemental/UI/Quest Log Window/UnityUIQuestLogWindow.cs:181)
PixelCrushers.DialogueSystem.QuestLogWindow.ShowQuests (QuestState questStateMask)
PixelCrushers.DialogueSystem.QuestLogWindow.OnOpenedWindow ()
PixelCrushers.DialogueSystem.UnityUIQuestLogWindow+<OpenAfterAnimation>c__Iterator8.MoveNext () (at Assets/Dialogue System/Scripts/Supplemental/UI/Quest Log Window/UnityUIQuestLogWindow.cs:153)
Is this some kind of race condition that's blowing up? Do I need to rig some kind of timer to prevent opening/closing too quickly?

Re: problem opening and closing quest log window

Posted: Thu Oct 01, 2015 11:01 am
by Tony Li
I'll take a look into this and reply back here later today. If there's a race condition, I'll make sure to fix it so you don't have to rig anything special.

Re: problem opening and closing quest log window

Posted: Thu Oct 01, 2015 12:22 pm
by Arcanor
Thanks again Tony for your excellent customer support! I look forward to your findings.

Re: problem opening and closing quest log window

Posted: Thu Oct 01, 2015 10:09 pm
by Tony Li
That race condition had to do with the show/hide animations, and it's fixed. You can download the updated Unity UI support scripts here:

DialogueSystem_UnityUI_Patch_2015-10-01.unitypackage

or on the Pixel Crushers private customer download site. I just PM'ed you your access info.

Re: problem opening and closing quest log window

Posted: Fri Oct 02, 2015 5:31 am
by Arcanor
Wow, you rock Tony! That is amazing support. Downloading now, I'll report back shortly with how it works for me here.

Re: problem opening and closing quest log window

Posted: Fri Oct 02, 2015 6:20 am
by Arcanor
I had some trouble importing the patch:

Code: Select all

Error importing folder (The pathName assets/dialogue system/scripts/supplemental/ui is already mapped to f440d45103a7ac64f8b6d2306261fd0b. But the meta data wants it to be mapped to cdae9acfa61f9a844aa43123cbcc0455)
Error importing folder (The pathName assets/dialogue system/scripts/supplemental/ui/bark ui is already mapped to 5072035f7e451414eaddcbcc2e7fb6e4. But the meta data wants it to be mapped to c8104b06c99afa54aa9593c87aa4c073)
Error importing folder (The pathName assets/dialogue system/scripts/supplemental/ui/dialogue ui is already mapped to f047d696d7286394d942f67b396e9f7b. But the meta data wants it to be mapped to f4042d9e1f2c6dd4d8166f998cff7109)
Error importing folder (The pathName assets/dialogue system/scripts/supplemental/ui/effects is already mapped to 32bc21da1ef56264b98b8be65e61cd21. But the meta data wants it to be mapped to 2f3d10ad3c7d6dc4b8028a6598c0cd46)
Error importing folder (The pathName assets/dialogue system/scripts/supplemental/ui/quest log window is already mapped to 42cc3c84fa4a1c24fa92a7bee37dd1fd. But the meta data wants it to be mapped to 9ea98ccc99ec5de478775f9cd6d89db0)
Error importing folder (The pathName assets/dialogue system/scripts/supplemental/ui/selector is already mapped to 8add9e09275aff14bae35c20102e5619. But the meta data wants it to be mapped to 72065f6298c720944999bdc5624f3034)
Error importing folder (The pathName assets/dialogue system/scripts/supplemental/ui/tools is already mapped to bf34e7c3f4e5d8d4d89ed9a3970cbc69. But the meta data wants it to be mapped to 83e7baa016af3294eb42df28a4cf4b00)
I'm never quite sure how to handle this. Any suggestions?

Re: problem opening and closing quest log window

Posted: Fri Oct 02, 2015 7:19 am
by Arcanor
I looked around and found this:

http://forum.unity3d.com/threads/error- ... ed.334680/

After reimporting the relevant folder, I'm still having a problem with "quick clicking" of the show/hide button. It's no longer causing an Error, but now I'm having the quest log responding intermittently after a quick click or two. Here's a short video to explain:

http://screencast.com/t/x4E4ZWVR9R

As you can hopefully see from the video, sometimes clicking doesn't work at all, until the user waits for several seconds between clicks. Other times, a single click will toggle the log on and immediately off again, as if there was a click queued up somehow. Help? :)

Re: problem opening and closing quest log window

Posted: Fri Oct 02, 2015 9:21 am
by Tony Li
The metadata error is innocuous. It's a remnant of converting from Unity 4.x to Unity 5.x. Several studios are still using Unity 4.x, so I included a single unitypackage patch that was exported in Unity 4.x.

Thanks for the screencast. That makes the issue clear. I'll try to have a final fix for this today.

Re: problem opening and closing quest log window

Posted: Sun Oct 04, 2015 11:13 pm
by Tony Li
Sorry for the delay in this. The fix is going to be in the 1.5.6 update that I'm trying to release on Tuesday.

To avoid duplicating code, I exposed a property in the underlying abstract quest log window class. This means it's not as easy as putting a Unity UI Support package on the customer download site. But Tuesday's update should handle show/hide animations very cleanly, and it also has the other UI features we talked about, like different appearances for different quest states in the quest tracker HUD.

Re: problem opening and closing quest log window

Posted: Mon Oct 05, 2015 4:55 am
by Arcanor
Sounds great Tony, thanks so much. I look forward to the update when it's available.