Page 1 of 1

Getting conversant data during a response

Posted: Mon Nov 30, 2020 10:31 am
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?

Re: Getting conversant data during a response

Posted: Mon Nov 30, 2020 1:25 pm
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.