Page 1 of 1

Set Actor or Conversant inside a conversation?

Posted: Wed Nov 03, 2021 10:46 am
by Abelius
Hi there,

This is weird, I know, but I think it would be nice to have the ability of setting/changing the actor and/or the conversant of an already started conversation. Preferably with a sequence command or a LUA fuction I can run from a dialogue entry.

Note: I mean the actual game object references, not the display names, or anything related to the nodes.

Is this possible already? There are plenty of ways to set them before the conversation has started, but I can't find anything to change them on the fly. That is: I want to 'reset' the participants of the active conversation.

I'm asking this because I have a pool of 16 NPC game objects with a Dialogue Actor component on them. Right now I have logic set in place that before I start a conversation I ask for a free NPC object, it sets up the character visually as it should be, changes the info on the Dialogue Actor component (so the Actor field is always 'NPC'), and then that GO is given to the Start Conversation action in PlayMaker as Conversant (Actor is always the Player gome object).

This is working well, but I'd like to go further and be able to call that logic from inside an already started conversation.

But for that to happen I'll need to be able to change the current Conversant game object reference.

Is there some hidden command I'm missing? Or is that info locked in once the convo starts?

Re: Set Actor or Conversant inside a conversation?

Posted: Wed Nov 03, 2021 11:15 am
by Tony Li
Hi,

Once a conversation starts, DialogueManager.conversationModel is valid. This has CharacterInfo properties actorInfo and conversantInfo. You can assign a new GameObject like this:

Code: Select all

DialogueManager.conversationModel.actorInfo.transform = SomeNewTransform;

Re: Set Actor or Conversant inside a conversation?

Posted: Wed Nov 03, 2021 11:19 am
by Abelius
Awesome, thanks!

Re: Set Actor or Conversant inside a conversation?

Posted: Wed Nov 03, 2021 11:25 am
by Tony Li
Glad to help!