Page 1 of 1

Problem Getting Actor Names

Posted: Mon Sep 07, 2015 3:11 pm
by Crabman
I have a simple conversation between two characters, which is working well enough, except the conversant's name is not displayed. Instead I get the name of the game object that triggers the conversation. This problem only occurs if the conversant is set in the conversation settings, if I use a different one there and then change it to the one I want in the dialogue entries themselves, it works.

Any idea what's going on there and how to fix it?

Re: Problem Getting Actor Names

Posted: Mon Sep 07, 2015 4:24 pm
by Tony Li
Hi,

What trigger component are you using (e.g., Conversation Trigger)?

What is the trigger type (e.g., OnUse or OnTriggerEnter)?

If you temporarily set the Dialogue Manager's Debug Level to Info and reproduce the issue, you should see a line that look something like this:

Code: Select all

Dialogue System: Starting conversation 'ConversationTitle', actor=Character1, conversant=Character2.
Which character is incorrect, the actor or the conversant?

(If you change the character in a dialogue entry, it bypasses the actor and conversant that were used to start the conversation. But this isn't something you'd want to do for every single dialogue entry in your conversation since it would be a huge hassle.)

Re: Problem Getting Actor Names

Posted: Mon Sep 07, 2015 5:20 pm
by Crabman
It's a Conversation Trigger, firing at the beginning of the scene with On Start.

And this is the output I'm getting:

Code: Select all

Dialogue System: Starting conversation 'Startup', actor=null, conversant=player (UnityEngine.Transform).

Dialogue System: Lua(Variable["Actor"] = "Dr. Bergstrom"; Variable["Conversant"] = "player")
So the actor gets the correct name and the conversant gets the name of the game object that has the Conversation Trigger. And I just noticed that that's the case with all the conversations, only that the others (triggered On Use) are attached to game objects with the correct name.

Perhaps the way I'm setting it up is wrong. I'm not setting actor/conversant transforms in the Conversation Trigger since I'm not using sequences/camera angles (it's a classic 2D Point&Click) and there aren't always objects for the actors (you mostly talk to a disembodied voice). I have added the actors to the database though and do set them in the settings for each conversation. I assumed that would be enough but perhaps it's not?

Re: Problem Getting Actor Names

Posted: Mon Sep 07, 2015 5:45 pm
by Tony Li
The behavior is weird in your case, but for most cases it works best to default to the conversant to the trigger's GameObject (for example, when adding a trigger to an NPC). This allows developers to use the same conversation (e.g., a generic villager or shopkeeper conversation) for multiple NPCs.

What about adding an Override Actor Name component to the GameObject? Then you can enter the correct name in the Override Name field.

Re: Problem Getting Actor Names

Posted: Mon Sep 07, 2015 7:13 pm
by Crabman
I see. Well, Override Actor Name works, so I'll go with that. Thanks.

Re: Problem Getting Actor Names

Posted: Mon Sep 07, 2015 8:54 pm
by Tony Li
Happy to help! If you have any questions about setting it up, just let me know.