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!
Get Actor Details Set In Conversation Editor
Re: Get Actor Details Set In Conversation Editor
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:
If you're trying to get them in a conversation, use [var=Actor] and [var=Conversant]. Example:
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}");
- Dialogue Text: "Hi, [var=Actor]. I'm an NPC named [var=Conversant]."