Page 1 of 14
About Dialogue Actor component
Posted: Sat Mar 06, 2021 6:19 am
by CHOPJZL
Hi,
Is it a bad practice we should avoid that I set multiple gameobjects to a same name, and add each of them a Dialogue Actor component with the same Actor name? Like the demo2 did on the Enemies.
There is a round check on the right of Actor filed , if I clicked it, I can write custom string in the Actor filed instead of choosing from the database. What can we do with the custom string?
If I import both DS and TopDown Engine, the DS demos are broken. Player falls from the floor when I hit play. The DS TopDown Example works fine
Re: About Dialogue Actor component
Posted: Sat Mar 06, 2021 9:21 am
by Tony Li
Hi,
CHOPJZL wrote: ↑Sat Mar 06, 2021 6:19 amIs it a bad practice we should avoid that I set multiple gameobjects to a same name, and add each of them a Dialogue Actor component with the same Actor name? Like the demo2 did on the Enemies.
It's OK to set multiple GameObjects to the same name if you don't need to identify a unique one (e.g., for a conversation).
CHOPJZL wrote: ↑Sat Mar 06, 2021 6:19 amThere is a round check on the right of Actor filed , if I clicked it, I can write custom string in the Actor filed instead of choosing from the database. What can we do with the custom string?
This lets you override the actor's display name. If you assign that actor to a Dialogue System Trigger's Conversation Actor or Conversation Conversant field, then the name you typed in will appear as the portrait name.
CHOPJZL wrote: ↑Sat Mar 06, 2021 6:19 amIf I import both DS and TopDown Engine, the DS demos are broken. Player falls from the floor when I hit play. The DS TopDown Example works fine
The DS demos use Unity's default physics layers. TDE changes the project's physics layers.
Re: About Dialogue Actor component
Posted: Sat Mar 06, 2021 10:20 am
by CHOPJZL
It's OK to set multiple GameObjects to the same name if you don't need to identify a unique one
I assume I need to make them unique if I use SequencerCommands that require a subject, right?
This lets you override the actor's display name. If you assign that actor to a Dialogue System Trigger's Conversation Actor or Conversation Conversant field, then the name you typed in will appear as the portrait name.
Do you mean in this way I turn a gameobject to a Conversation Actor that is not exist in the database?
Re: About Dialogue Actor component
Posted: Sat Mar 06, 2021 11:20 am
by Tony Li
Yes to both questions.
Re: About Dialogue Actor component
Posted: Sat Mar 06, 2021 7:33 pm
by CHOPJZL
But there are Actors already set in each Dialogue Entry. Isn't the custome one conflict with them? Or should I set the Actor and conversant to (None) under the circumstances?
Re: About Dialogue Actor component
Posted: Sat Mar 06, 2021 8:02 pm
by Tony Li
Hi,
Please see:
Character GameObject Assignments
Let's say that, in the Dialogue Editor, you set the conversation's Actor to "Adam".
In your scene, you have a GameObject with a Dialogue Actor component set to "Bob".
In your Dialogue System Trigger, if you set the Conversation Actor to Bob, then Bob will speak all nodes that were assigned to Adam.
The Character GameObject Assignments section has a better example. Say you set the conversation's Actor to "Generic Shopkeeper Placeholder".
In one town (scene), there's an NPC "Shopkeeper Cindy". In another town, there's a different NPC "Shopkeeper Doug".
In the first town, you can assign "Shopkeeper Cindy" as the Conversation Actor. Then Shopkeeper Cindy will speak all the nodes assigned to Generic Shopkeeper Placeholder.
In the second town, you can assign "Shopkeeper Doug" as the Conversation Actor. Then Shopkeeper Doug will speak all the nodes assigned to Generic Shopkeeper Placeholder.
Re: About Dialogue Actor component
Posted: Sat Mar 06, 2021 8:43 pm
by CHOPJZL
Wow, this is a great feature.
Have you considered to make the Conversation Conversant to be a list in Trigger and Editor? In this way we can make the conversation reusable for more than 2 participants.
Re: About Dialogue Actor component
Posted: Sat Mar 06, 2021 9:33 pm
by Tony Li
I'll give that some thought. There's a workaround you can use right now:
Say the conversation's Actor is Ann and Conversant is Bob, and the conversation has a third actor named Grump who says "Get outta my way!"
In scene 1, there's a grumpy man.
In scene 2, there's a grumpy woman.
In scene 1, add a Dialogue Actor to the grumpy man, and set it to Grump. Then set the Grump actor's Display Name to "Grumpy Man":
Code: Select all
DialogueLua.SetActorField("Grump", "Display Name", "Grumpy Man");
In scene 1, the grumpy man will register himself as the GameObject representing the Grump actor. When the conversation plays in scene 1, it will use the grumpy man, and the portrait name will be "Grumpy Man".
In scene 2, add a Dialogue Actor to the grumpy woman, and set it to Grump. Then set the Grump actor's Display Name to "Grumpy Woman":
Code: Select all
DialogueLua.SetActorField("Grump", "Display Name", "Grumpy Woman");
In scene 2, the grumpy woman will register herself as the GameObject representing the Grump actor. When the conversation plays in scene 2, it will use the grumpy woman, and the portrait name will be "Grumpy Woman".
Re: About Dialogue Actor component
Posted: Sun Mar 07, 2021 6:39 am
by CHOPJZL
Will "Shopkeeper Cindy" and "Shopkeeper Doug" inherit the Fields of "Generic Shopkeeper Placeholder"?
What will happen if the conversation goes to an Entry that belongs to another conversation?
Re: About Dialogue Actor component
Posted: Sun Mar 07, 2021 9:19 am
by Tony Li
CHOPJZL wrote: ↑Sun Mar 07, 2021 6:39 amWill "Shopkeeper Cindy" and "Shopkeeper Doug" inherit the Fields of "Generic Shopkeeper Placeholder"?
No. You can still access those fields by the "Generic Shopkeeper" name in your Conditions and Scripts if you need to, such as:
Code: Select all
Actor["Generic_Shopkeeper_Placeholder"].OpenForBusiness = true
CHOPJZL wrote: ↑Sun Mar 07, 2021 6:39 amWhat will happen if the conversation goes to an Entry that belongs to another conversation?
"Shopkeeper Cindy" or "Shopkeeper Doug" will still be associated with the "Generic Shopkeeper Placeholder" actor when it cross-links to another conversation.