Page 1 of 1

Changing Active Conversation in Code

Posted: Mon Jan 06, 2025 1:46 am
by luckiLamps
Hi Tony!

I'm wondering if there is a way to change/set the active/currentConversation through code.
I'm using links, such as in your Keywords example extra, to set the response for dialogue in the subtitle text, but I'm having trouble with simultaneous conversations.
I'm using the following to select a response for the conversation which is working fine with a single conversation.

Response response = DialogueManager.instance.currentConversationState.pcResponses[optionId];
DialogueManager.Instance.conversationController.SetCurrentResponse(response);
DialogueManager.Instance.conversationController.GotoCurrentResponse();

But it doesn't work with multiple conversations up. What I'm hoping for is something that sets the currentConversation that I can call before the lines above.
Alternatively, if you have any other ideas on how to manage this, that would be great.

(I've also tried Stopping Conversation & Starting at Entry of the next response, but couldn't get control of the conversation I'm stopping and was having other issues starting the conversation)

Thanks heaps in advance!

Re: Changing Active Conversation in Code

Posted: Mon Jan 06, 2025 8:17 am
by Tony Li
Hi,

When you're playing multiple simultaneous conversations, DialogueManager.instance.activeConversations contains the list of all active conversations.

Also, in special script methods such as OnConversationLine, DialogueManager.currentConversationState is set to the relevant conversation's state.