Getting conversant data during a response

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
chen66
Posts: 1
Joined: Mon Nov 30, 2020 9:57 am

Getting conversant data during a response

Post by chen66 »

Hi, thanks for the great plugin. I am very happy with it!

I am having some trouble with getting the conversant data during a response.
During a conversation I wish to update data each time an NPC talks or when the player is shown the response menu.

when NPC talks I can access subtitle data, during a response menu I can access subtitle data via CurrentConversationState.subtitle, or via responses[].destinationEntry

the currentconversationstate subtitle refers to the previous node, so I think I must use the destinationEntry, how should I obtain data about an actor from conversant ID?

I understand why it works this way, because the character did not speak yet, but I wish to preview data about the NPC before talking to them. Is there a better way I can achieve this?
User avatar
Tony Li
Posts: 22050
Joined: Thu Jul 18, 2013 1:27 pm

Re: Getting conversant data during a response

Post by Tony Li »

Hi,

There are several ways to get that information. If there is only one actor and one conversant in the conversation, you can reference DialogueManager.currentActor and currentConversant to get their transforms, or DialogueManager.conversationModel.actorInfo and conversantInfo to get detailed information.

If the conversation has many participants and you need to know who the destination entry is addressing, check the destination entry's ConversantID. From there, you can use DialogueManager.masterDatabase.GetActor(conversantID) to get the actor's database info.
Post Reply