Page 1 of 1

Error Message of OnConversationStart Trigger

Posted: Mon Dec 27, 2021 7:11 am
by molasses
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 :

Code: Select all

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?

Re: Error Message of OnConversationStart Trigger

Posted: Mon Dec 27, 2021 7:40 am
by Tony Li
Hi,

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.

Re: Error Message of OnConversationStart Trigger

Posted: Tue Dec 28, 2021 4:28 am
by molasses
Hi, I tried both of your advice and unfortunately, the error still exists.

I set my Dialogue System Trigger to OnUse. In Behavior Designer, I replace the StartConversation task with Send Message task.

It's so confused.

Re: Error Message of OnConversationStart Trigger

Posted: Tue Dec 28, 2021 9:20 am
by Tony Li
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.

DS_SimpleBehaviorDesignerExample_2021-12-28.unitypackage

If this example doesn't demonstrate what you need to know, please let me know what you want to accomplish.

Re: Error Message of OnConversationStart Trigger

Posted: Thu Dec 30, 2021 7:04 am
by molasses
It seems that this error does not hinder the operation of the gameļ¼Œ but I still wonder how to clean this error?

Re: Error Message of OnConversationStart Trigger

Posted: Thu Dec 30, 2021 9:24 am
by Tony Li
Can you post your OnConversationStart() method that is in your class NPCAI?

The signature of the method should be:

Code: Select all

public void OnConversationStart(Transform actor)
{ ...

Re: Error Message of OnConversationStart Trigger

Posted: Thu Dec 30, 2021 10:55 pm
by molasses
Thanks! the problem has been solved, the signature does have some difference :D

Re: Error Message of OnConversationStart Trigger

Posted: Fri Dec 31, 2021 9:01 am
by Tony Li
Great! I'm glad you got to the bottom of it.