Page 1 of 1

Get Actor Details Set In Conversation Editor

Posted: Wed Jun 02, 2021 10:11 pm
by zenmaster
Hiya.

Can you please tell me how I'd go about getting the name and the ID of the actor and the conversant set in the dialogue editor window?

I only have conversations between two entities, and they're comfortably set in the conversation window and shown down the bottom right. Using the conversation title I'm trying to get those actor details at runtime and can't quite figure it out.

Thank you!

Re: Get Actor Details Set In Conversation Editor

Posted: Wed Jun 02, 2021 11:01 pm
by Tony Li
Hi,

If you're trying to get them in a C# script, a Conversation has ActorID and ConversantID fields. From those, you can get the Actors and their names:

Code: Select all

Conversation conversation = DialogueManager.masterDatabase.GetConversation("Some Conversation Title");
Actor actor = DialogueManager.masterDatabase.GetActor(conversation.ActorID);
Actor conversant = DialogueManager.masterDatabase.GetActor(conversation.ConversantID);
Debug.Log($"This conversation is between {actor.Name} and {conversant.Name}");
If you're trying to get them in a conversation, use [var=Actor] and [var=Conversant]. Example:
  • Dialogue Text: "Hi, [var=Actor]. I'm an NPC named [var=Conversant]."

Re: Get Actor Details Set In Conversation Editor

Posted: Thu Jun 03, 2021 8:12 am
by zenmaster
tenor (1).gif
tenor (1).gif (34.93 KiB) Viewed 128 times