About Dialogue Actor component
Re: About Dialogue Actor component
Does the code "DialogueManager.StartConversation("Some Conversation", actor.transform, conversant.transform);" has the same function if I add Dialogue Actor component to actor and conversant?
If I set up a "Shopkeeper Cindy" or "Shopkeeper Doug", and select he/she as the conversant, can I set Conditions and Scripts base on the real Speaker(Cindy/Doug)? Since the conversation just know Generic Shopkeeper, I did't find a way in Conditions and Scripts to select "Speaker"
On the other hand, through code like DialogueLua.GetActorField(subtitle.speakerInfo.nameInDatabase, "FieldName"), I can get a custom Field from Cindy/Doug. Am I right?
If I set up a "Shopkeeper Cindy" or "Shopkeeper Doug", and select he/she as the conversant, can I set Conditions and Scripts base on the real Speaker(Cindy/Doug)? Since the conversation just know Generic Shopkeeper, I did't find a way in Conditions and Scripts to select "Speaker"
On the other hand, through code like DialogueLua.GetActorField(subtitle.speakerInfo.nameInDatabase, "FieldName"), I can get a custom Field from Cindy/Doug. Am I right?
Re: About Dialogue Actor component
Yes. It associates actor.transform with the conversation's actor and conversant.transform with the conversation's conversant.
Add "Shopkeeper Cindy" and "Shopkeeper Doug" as actors in your database, in addition to "Generic Shopkeeper Placeholder".CHOPJZL wrote: ↑Sun Mar 07, 2021 10:25 amIf I set up a "Shopkeeper Cindy" or "Shopkeeper Doug", and select he/she as the conversant, can I set Conditions and Scripts based on the real Speaker(Cindy/Doug)? Since the conversation just knows Generic Shopkeeper, I didn't find a way in Conditions and Scripts to select "Speaker"
Write your conversation using Generic Shopkeeper Placeholder.
When you pass Shopkeeper Cindy as the conversant, Variable["Conversant"] will be "Shopkeeper Cindy", and Variable["ConversantIndex"] will be "Shopkeeper_Cindy". To you can check Shopkeeper Cindy's IsStoreOpen field like this:
Code: Select all
Actor[Variable["ConversantIndex"]].IsStoreOpen == true
Only if Cindy and Doug are in the database. Otherwise nameInDatabase will be "Generic Shopkeeper Placeholder".
Re: About Dialogue Actor component
Hi,
Today I tried to set a Private Hart's DisplayName in Script. But the Actor's name is unchanged through out the conversation. Then the name changed when I speak to him again for another conversation.
I saw there is a post about having a fixed button list to limit the menu panel to only show several of the responses. If I add a Timeout and set the Timeout Action to Choose Random Response, Will that be risky to select a response that is not shown in the menu?
Is there a way to order the responses at random by weight factor(such as Custom Field)? It's better to be able to set some branches to be at front, and others sort randomly. This question is related to above one. So that it is able to add some variaty to the conversation, and I can set the Timeout Action to Choose First Response.
Then I saw this post. Now the problem become how to shuffle by weight factor.
The same queston to random bark and RandomizeNextEntry() for Npc dialogue, seems there is no Response[] for me to shuffle.
Today I tried to set a Private Hart's DisplayName in Script. But the Actor's name is unchanged through out the conversation. Then the name changed when I speak to him again for another conversation.
I saw there is a post about having a fixed button list to limit the menu panel to only show several of the responses. If I add a Timeout and set the Timeout Action to Choose Random Response, Will that be risky to select a response that is not shown in the menu?
Is there a way to order the responses at random by weight factor(such as Custom Field)? It's better to be able to set some branches to be at front, and others sort randomly. This question is related to above one. So that it is able to add some variaty to the conversation, and I can set the Timeout Action to Choose First Response.
Then I saw this post. Now the problem become how to shuffle by weight factor.
The same queston to random bark and RandomizeNextEntry() for Npc dialogue, seems there is no Response[] for me to shuffle.
Re: About Dialogue Actor component
Hi,
See the Discover Name Example on the Dialogue System Extras page. It shows how to change the Display Name in the middle of a conversation.
Using that technique, yes. Instead, set it to Custom and use a custom handler. Or Choose First Response if you use your idea below.CHOPJZL wrote: ↑Tue Mar 09, 2021 6:07 amI saw there is a post about having a fixed button list to limit the menu panel to only show several of the responses. If I add a Timeout and set the Timeout Action to Choose Random Response, Will that be risky to select a response that is not shown in the menu?
Base your script off the one in that post. You can add a new custom field to your dialogue entry template (e.g,. "Weight Factor"). In your OnConversationResponseMenu() method, use the Weight Factor field instead of randomly sorting everything with equal weight. To get the Weight Factor value for a response's dialogue entry:CHOPJZL wrote: ↑Tue Mar 09, 2021 6:07 amIs there a way to order the responses at random by weight factor(such as Custom Field)? It's better to be able to set some branches to be at front, and others sort randomly. This question is related to above one. So that it is able to add some variaty to the conversation, and I can set the Timeout Action to Choose First Response.
Then I saw this post. Now the problem become how to shuffle by weight factor.
Code: Select all
Response response = responses[i];
float weightFactor = Field.LookupFloat(response.destinationEntry.fields, "Weight Factor");
Barks don't provide a way to change that. It's probably better if you handle it manually:
Code: Select all
var conversationModel = new ConversationModel(DialogueManager.masterDatabase, "Bark Conversation", speaker, listener, false, null);
Response[] = conversationModel.firstState.npcResponses;
// (Shuffle responses here.)
DialogueManager.BarkString(response[0].destinationEntry.currentDialogueText, speaker);
Re: About Dialogue Actor component
How about RandomizeNextEntry() for Npc dialogue? Is it possible for you to make the Random logic virtual? Maybe take the npcResponses of the current state as the parameter.
About this post, I tried the example, But the "Response Menu Panel" dosen't get active at NPC line 4.
About this post, I tried the example, But the "Response Menu Panel" dosen't get active at NPC line 4.
Re: About Dialogue Actor component
I don't follow. For barks or conversations? I can add a hook where you can assign a replacement for the random selection code.
Which example? There are two.
Re: About Dialogue Actor component
It's best to have both. For now it's GetNextIndex(int numEntries) for bark, GetRandomNPCEntry() for conversation.I don't follow. For barks or conversations? I can add a hook where you can assign a replacement for the random selection code.
It's the second example, the NPC line 3 set "Response Menu Panel" inactive, and NPC line 4 should set it active again.Which example? There are two.
Re: About Dialogue Actor component
I opened a new project, and yes, it works properly.
I don't know why in my old project in NPC line 4 the setactive called and seems work, but still the "Response Menu Panel" remain inactive
I don't know why in my old project in NPC line 4 the setactive called and seems work, but still the "Response Menu Panel" remain inactive
Re: About Dialogue Actor component
Hi,
How to set the Actor's subtitle color if there is no Dialogue Actor component of him in the scene?
About "Typed" message, If there are 2 conversation running at the same time, will the "Typed" message be conflict?
Is it possible to start 2 entry at the same time as a group, or start the second entry before the first finishes, and the first entry's sequence don't need to stop. As for UI, let's take 2 different NPC panel for an example.
How to set the Actor's subtitle color if there is no Dialogue Actor component of him in the scene?
About "Typed" message, If there are 2 conversation running at the same time, will the "Typed" message be conflict?
Is it possible to start 2 entry at the same time as a group, or start the second entry before the first finishes, and the first entry's sequence don't need to stop. As for UI, let's take 2 different NPC panel for an example.