Hi, Tony
I start my conversation in a Behavior Designer Task Script by using function:
DialogueManager.StartConversation(conversationTitle, actorTransform, conversantTransform);
Then I add a Dialogue System Trigger on NPC and set the tigger as "On Conversation Start". But everytime I start or end a conversation, I got this error :
Failed to call function OnConversationStart of class NPCAI
Calling function OnConversationStart with 1 parameter but the function requires 2.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
PixelCrushers.DialogueSystem.ConversationModel:InformParticipants (string,bool) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:195)
Any ideas about the solution?
Attachments
Dialogue System Trigger
2021-12-27_200732.png (29.62 KiB) Viewed 319 times
Generally speaking, you should start only one conversation at a time. (You can change this by ticking the Dialogue Manager's Other Settings > Allow Simultaneous Conversations, but I don't think that's what you intend.)
I recommend starting the conversation by using Behavior Designer's Start Conversation task or using a Dialogue System Trigger set to OnUse, but not both.
If you use a Behavior Designer Start Conversation task, assign PlayerPrefab_Model_Femal to the Actor field and DogNPC to the Conversant field.
If you use a Dialogue System Trigger, set it to OnUse. In Behavior Designer, use a Unity > GameObject > Send Message task to send "OnUse" to the Dialogue System Trigger's GameObject.
Here's a really simple example. The scene has a GameObject named NPC with a behavior tree. The behavior tree waits 1 second and then starts a conversation using a Start Conversation task node.
The NPC also has a Dialogue System Events component whose OnConversationStart() event activates a GameObject. There's no purpose to activating the GameObject except to demonstrate that the OnConversationStart() event works.