Error Message of OnConversationStart Trigger

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
molasses
Posts: 5
Joined: Mon Dec 27, 2021 6:58 am

Error Message of OnConversationStart Trigger

Post 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?
Attachments
Dialogue System Trigger
Dialogue System Trigger
2021-12-27_200732.png (29.62 KiB) Viewed 357 times
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Error Message of OnConversationStart Trigger

Post 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.
molasses
Posts: 5
Joined: Mon Dec 27, 2021 6:58 am

Re: Error Message of OnConversationStart Trigger

Post 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.
Attachments
dst
dst
2021-12-28_170033.png (38.54 KiB) Viewed 345 times
behavior tree
behavior tree
2021-12-28_172633.png (22.54 KiB) Viewed 345 times
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Error Message of OnConversationStart Trigger

Post 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.
molasses
Posts: 5
Joined: Mon Dec 27, 2021 6:58 am

Re: Error Message of OnConversationStart Trigger

Post by molasses »

It seems that this error does not hinder the operation of the game, but I still wonder how to clean this error?
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Error Message of OnConversationStart Trigger

Post 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)
{ ...
molasses
Posts: 5
Joined: Mon Dec 27, 2021 6:58 am

Re: Error Message of OnConversationStart Trigger

Post by molasses »

Thanks! the problem has been solved, the signature does have some difference :D
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Error Message of OnConversationStart Trigger

Post by Tony Li »

Great! I'm glad you got to the bottom of it.
Post Reply