Get Actor Details Set In Conversation Editor

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
zenmaster
Posts: 7
Joined: Mon May 24, 2021 10:10 am

Get Actor Details Set In Conversation Editor

Post 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!
User avatar
Tony Li
Posts: 22162
Joined: Thu Jul 18, 2013 1:27 pm

Re: Get Actor Details Set In Conversation Editor

Post 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]."
zenmaster
Posts: 7
Joined: Mon May 24, 2021 10:10 am

Re: Get Actor Details Set In Conversation Editor

Post by zenmaster »

tenor (1).gif
tenor (1).gif (34.93 KiB) Viewed 125 times
Post Reply