Change Conversant during Conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ar4wy
Posts: 26
Joined: Fri Nov 15, 2019 10:16 pm

Change Conversant during Conversation

Post by ar4wy »

Hi Tony!

How do I change the conversant during a conversation?

I found this elsewhere on the forum:

Code: Select all

PixelCrushers.DialogueSystem.DialogueManager.ConversationModel.ConversantInfo.transform = someOtherTransform
However, when I try to brute for this (on update loop), my other script keeps printing the original conversant as the current conversant.

So in this test, on one script, I have the code line above in Update(), and in another script, I have "DialogueManager.CurrentConversant" being printed in Update().

When I try to change the conversant with the line above, it doesn't work.

Could you let me know if there is a way to do this?

Best!
Remy
ar4wy
Posts: 26
Joined: Fri Nov 15, 2019 10:16 pm

Re: Change Conversant during Conversation

Post by ar4wy »

Ha!

I just got something working. Instead of getting the currentConversant using:

Code: Select all

DialogueManager.CurrentConversant
I just got the same info (but this one seems to update), using:

Code: Select all

DialogueManager.ConversationModel.ConversantInfo.transform


If there is a better way to do this, please let me know :)
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change Conversant during Conversation

Post by Tony Li »

Hi Remy,

That will work for changing the conversant.

However, you also may not need to change the conversant. You can involve additional characters in a conversation. Conversations are not limited to two participants. To involve an additional character, inspect a dialogue entry node and change its Actor dropdown to the new character.

Then add a Dialogue Actor component to the new character's GameObject, and select that actor. This will associate the GameObject with the actor in case the conversation's Sequences need to play audio, animation, etc., on it.
ar4wy
Posts: 26
Joined: Fri Nov 15, 2019 10:16 pm

Re: Change Conversant during Conversation

Post by ar4wy »

Hi Tony!

Thanks!

Are these two getting the same thing? What is the difference?

DialogueManager.CurrentConversant
DialogueManager.ConversationModel.ConversantInfo.transform
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change Conversant during Conversation

Post by Tony Li »

In almost all cases, they should be the same thing. They're set according to these rules: Character GameObject Assignment.
Post Reply