Page 1 of 1

Change Conversant during Conversation

Posted: Sat Nov 28, 2020 5:23 am
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

Re: Change Conversant during Conversation

Posted: Sat Nov 28, 2020 5:32 am
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 :)

Re: Change Conversant during Conversation

Posted: Sat Nov 28, 2020 7:52 am
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.

Re: Change Conversant during Conversation

Posted: Sat Nov 28, 2020 6:37 pm
by ar4wy
Hi Tony!

Thanks!

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

DialogueManager.CurrentConversant
DialogueManager.ConversationModel.ConversantInfo.transform

Re: Change Conversant during Conversation

Posted: Sat Nov 28, 2020 7:31 pm
by Tony Li
In almost all cases, they should be the same thing. They're set according to these rules: Character GameObject Assignment.