Quest Entry values

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Quest Entry values

Post by nathanj »

Hi Tony

I'm trying to find where I can get information about what details I can display dynamically in the Quest Entry field of the Quest editor. For example, something like[lua(Variable["Firewood"])] of 3 collected but for a quest state instead.

I tried changing it to [lua(CurrentQuestEntryState["Entry 1"])] but it thorws this error:

Code: Select all

Dialogue System: Lua code 'return CurrentQuestEntryState["Entry 1"]' threw exception 'Lookup of field 'Entry 1' in the table element failed because the table element itself isn't in the table.'
UnityEngine.Debug:LogError(Object)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean)
PixelCrushers.DialogueSystem.FormattedText:<ReplaceLuaTags>m__35(Match)
System.Text.RegularExpressions.Regex:Replace(String, MatchEvaluator)
PixelCrushers.DialogueSystem.FormattedText:ReplaceLuaTags(String&)
PixelCrushers.DialogueSystem.FormattedText:Parse(String, EmphasisSetting[])
PixelCrushers.DialogueSystem.TextMeshPro.TextMeshProQuestTracker:InstantiateQuestTrack(String) (at Assets/Dialogue System/Third Party Support/TextMesh Pro/Scripts/Quest Log Window/TextMeshProQuestTracker.cs:147)
PixelCrushers.DialogueSystem.TextMeshPro.TextMeshProQuestTracker:UpdateTracker() (at Assets/Dialogue System/Third Party Support/TextMesh Pro/Scripts/Quest Log Window/TextMeshProQuestTracker.cs:106)
UnityEngine.Component:BroadcastMessage(String, SendMessageOptions)
PixelCrushers.DialogueSystem.DialogueManager:SendUpdateTracker()
PixelCrushers.DialogueSystem.QuestLog:SendUpdateTracker()
PixelCrushers.DialogueSystem.QuestLog:DefaultSetQuestState(String, String)
PixelCrushers.DialogueSystem.QuestLog:SetQuestState(String, String)
System.Reflection.MethodBase:Invoke(Object, Object[])
Language.Lua.LuaMethodFunction:InvokeMethod(LuaValue[])
Language.Lua.FunctionCall:Evaluate(LuaValue, LuaTable)
Language.Lua.PrimaryExpr:Evaluate(LuaTable)
Language.Lua.ExprStmt:Execute(LuaTable, Boolean&)
Language.Lua.Chunk:Execute(Boolean&)
Language.Lua.Chunk:Execute()
Language.Lua.LuaInterpreter:Interpreter(String, LuaTable)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry, Boolean, Boolean, Boolean)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry)
PixelCrushers.DialogueSystem.ConversationController:OnSelectedResponse(Object, SelectedResponseEventArgs)
PixelCrushers.DialogueSystem.ConversationView:SelectResponse(SelectedResponseEventArgs)
PixelCrushers.DialogueSystem.ConversationView:OnSelectedResponse(Object, SelectedResponseEventArgs)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnClick(Object)
UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
PixelCrushers.DialogueSystem.TextMeshPro.TextMeshProResponseButton:OnClick() (at Assets/Dialogue System/Third Party Support/TextMesh Pro/Scripts/Dialogue UI/TextMeshProResponseButton.cs:173)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
PixelCrushers.UIButtonKeyTrigger:Update() (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIButtonKeyTrigger.cs:35)
Thanks in advance

Nathan
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Entry values

Post by Tony Li »

Hi Nathan,

You can certainly use CurrentQuestEntryState, but the format is very specific (and documented here). To get the state of entry #1 in a quest named "Start Fire", use this:

Code: Select all

CurrentQuestEntryState("Start Fire", 1)
So your quest entry text might look like this:

Code: Select all

The state of entry 1 is [lua( CurrentQuestEntryState("Start Fire", 1) )].
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Quest Entry values

Post by nathanj »

Right,

Thanks for the explanation and the link.

Nathan
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Entry values

Post by Tony Li »

Happy to help!
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Quest Entry values

Post by nathanj »

Hey Tony

Furthering along with this subject. Is it possible to have Quest Entries disappear from the HUD once completed?

I could set it up that each Entry was a separate quest but if I could just have only active entries displaying in the HUD it would make the set up much simpler.

I'm using the Text Mesh Pro Quest Tracker and see a "Show Completed Entry Text" field but it is already deselected so I doubt it is it.

Thanks in advance, yet again...
Nathan
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Entry values

Post by Tony Li »

Sorry, that's a bug. The quest tracker wasn't respecting the value of the Show Completed Entries checkbox. You can download the updated Text Mesh Pro Support package on the Dialogue System Extras page or here: direct download.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Quest Entry values

Post by nathanj »

Amazing. Thank you.
Post Reply