Quest states

Announcements, support questions, and discussion for the Dialogue System.
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

Hey Tony,
I'm just getting around to quests again and I'm not able to get the journal thing to work. I have what you posted above but it doesn't seem to see preempted as "active" or anything other than "preempted". When the item is obtained, the quest disappears from the journal until it's turned in. As I mentioned above, I'd like to have some sort or quest state that reminds the player to turn the quest in.

Thanks.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest states

Post by Tony Li »

Hi,

Are you using a custom subclass of StandardUIQuestLogWindow as mentioned in this post?
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

yes I am, everything is the same. I'm not sure if I've even upgraded at all but I know I have kept all the custom scripts you helped me make.
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

So, the "preempted" works fine for the quest indicators as it did before, but I never got around to messing with the quest journal until now. So that's where I am with that. If I use anything other than ShowQuest(QuestState.Acvitve) then when I click the show active quests, the show completed quests button stays highlighted and the active quest actually shows up but it shows up as a completed quest and the buttons no longer work. It's weird.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest states

Post by Tony Li »

The script (in the post linked above) needed a little adjustment. I updated the post. Here's a working example scene:

PreemptedQuestExample_2019-09-28.unitypackage

Note that I included the CustomStringToState code in the custom quest log window script to keep the example small.
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

that's working now, thank you. What I'm really trying to wrap my head around is where to put information about the intermediate part of the quest. How do I get the journal to show something like "You got the diamond! Take it back to Jerkface for your reward". As of right now it just still shows the active quest details.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest states

Post by Tony Li »

You could make the Description field blank, and put that information in separate quest entries. For example:

Entry 1: "Jerkface gave you a quest to get a diamond. You have it. Now take it back to Jerkface."

Entry 2: "You got the diamond without being asked to get it! Take it back to Jerkface for your reward."

If the quest goes active, set Entry 1 active.

If the quest is preempted, set Entry 2 active.
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

I'm getting an error. Do I need to delete the other entries in the fields section? Right now I have two entry 1's and two entry 2's.
But the first one of each is for QuestState. Like so.

Also, this is the error:
NullReferenceException: Object reference not set to an instance of an object
PixelCrushers.DialogueSystem.StandardUIQuestTrackTemplate.AddEntryDescription (System.String text, PixelCrushers.DialogueSystem.QuestState entryState) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Quest/StandardUIQuestTrackTemplate.cs:118)
PixelCrushers.DialogueSystem.StandardUIQuestTracker.AddQuestTrack (System.String quest) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Quest/StandardUIQuestTracker.cs:277)
PixelCrushers.DialogueSystem.StandardUIQuestTracker+<RefreshAtEndOfFrame>d__28.MoveNext () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Quest/StandardUIQuestTracker.cs:215)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)


Image
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

Nevermind, I think I found the problem. Not sure how it worked fine before making the changes but after changing to TextMeshPro I missed setting the Entry Container on StandardUIQuestTracker. How it worked without it before I don't know. I'm sure you do though. I guess the entries were defaulted to title until I added custom entries? Just a guess.

Anyway, the error is gone and I'm able to get custom entry 1 to show but entry 2 does not.
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

Well, I made a new custom state for Active called "complete" and set entry 2 by sending the message

UpdateTracker()
if (CurrentQuestState("Something for Rose") == "active") then
SetQuestState("Something for Rose", "preempted")
SetQuestEntryState("Something for Rose", 2, "complete")
end

it actually adds entry 2 now along with entry 1. I just changed the color of entry 2. That's good enough I suppose unless there is an easy way to not show entry 1 with entry 2 otherwise. It works fine.

Thanks
Post Reply