Page 1 of 1

Lua error exception when using DialogueSystem

Posted: Thu Jan 28, 2021 10:59 am
by JohnP
I am trying to integrate QuestMachine and DialogueSystem into my project by replicating the tutorial example, I've got the DS conversation part working, however when I try to assign the quest with GiveQuest("Quest Giver", "exploreCircle") as per the tutorial video, I get this error:

(The Lua Conditions check CurrentQuestState("exploreCircle") == "unassigned" didn't seem to throw any errors on the previous node if this helps with debugging.)

Code: Select all

Dialogue System: Lua code 'GiveQuest("Quest Giver", "exploreCircle")' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'
UnityEngine.Debug:LogError(Object)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:228)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:129)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry, Boolean, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:234)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:304)
PixelCrushers.DialogueSystem.ConversationController:OnSelectedResponse(Object, SelectedResponseEventArgs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:297)
PixelCrushers.DialogueSystem.ConversationView:SelectResponse(SelectedResponseEventArgs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:475)
PixelCrushers.DialogueSystem.ConversationView:OnSelectedResponse(Object, SelectedResponseEventArgs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:468)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnClick(Object) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Abstract/Dialogue/AbstractDialogueUI.cs:346)
PixelCrushers.DialogueSystem.StandardDialogueUI:OnClick(Object) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardDialogueUI.cs:234)
UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
PixelCrushers.DialogueSystem.StandardUIResponseButton:OnClick() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUIResponseButton.cs:124)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2019.4.11f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)
Using latest version of QM/DS at time of posting, editor version 2019.4.11f1.

Edit:

Some extra info... my project is quite large and relies on many assets, the main backbone is Invector's Third Person Controller, however it was imported a few years ago and has been heavily modified, so not sure if the current procedures would apply.

The Player character is Instantiated into the scene at runtime along with the NPC (Quest Giver), I have created a gameobject with the Player Journal attached and placed in scene already as recommended in another post.

Re: Lua error exception when using DialogueSystem

Posted: Thu Jan 28, 2021 11:14 am
by Tony Li
Hi,

Did you add the Dialogue System Quest Machine Bridge component to the Dialogue Manager GameObject?

Re: Lua error exception when using DialogueSystem

Posted: Wed Feb 03, 2021 12:56 pm
by JohnP
This solved it, thank you very much :mrgreen:

Re: Lua error exception when using DialogueSystem

Posted: Wed Feb 03, 2021 1:25 pm
by Tony Li
Glad to help!