About Dialogue Actor component

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

Hi,
If my understanding is right, "OverrideDisplaySettings" component it self is used during the conversation as the settings. If the Actor that has the component is in 2 conversations(Like a talking and a Phone Textline), We can't set their DisplaySetting respectively. The Conversant side could be in 2 conversations, too. How about adding a new DisplaySettings when start the conversation?

it will be better if the "OverrideDisplaySettings" is able to set which part to override, Like the "Override Display Settings" in conversation. This is mainly because I don't want to override the global timeout duration.

By the way, How to properly set a specified overrided timeout duration, If I want to write a custom Sequencer command?


And similar question about ConversationID, if 2 active conversations are come from the same conversation in the Database, the ConversationID will be same, right? If so, how to find the specified active conversation that I want to deal with?


About the second example in this post, the "Response Menu Panel" dosen't get active at NPC line 4. Although I opened a new project, and it works properly. When I open another scene(for example the SampleScene that new project has), then go back to "Another Telltale Style Example" scene, It broke again.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

Hi
CHOPJZL wrote: Mon Mar 15, 2021 5:02 amHow about adding a new DisplaySettings when start the conversation?
In a future update, I can make the ConversationView.displaySettings property assignable so you can change it.
CHOPJZL wrote: Mon Mar 15, 2021 5:02 amit will be better if the "OverrideDisplaySettings" is able to set which part to override, Like the "Override Display Settings" in conversation. This is mainly because I don't want to override the global timeout duration.
I'll look into that for a future update.
CHOPJZL wrote: Mon Mar 15, 2021 5:02 amBy the way, How to properly set a specified overrided timeout duration, If I want to write a custom Sequencer command?
Set DialogueManager.displaySettings.inputSettings.responseTimeout or DialogueManager.conversationView.displaySettings.inputSettings.responseTimeout.
CHOPJZL wrote: Mon Mar 15, 2021 5:02 amAnd similar question about ConversationID, if 2 active conversations are come from the same conversation in the Database, the ConversationID will be same, right? If so, how to find the specified active conversation that I want to deal with?
If they involve different actors, you can check the active conversation record's actor and conversant transforms, or the conversationModel's actorInfo and conversantInfo.
CHOPJZL wrote: Mon Mar 15, 2021 5:02 amAbout the second example in this post, the "Response Menu Panel" dosen't get active at NPC line 4. Although I opened a new project, and it works properly. When I open another scene(for example the SampleScene that new project has), then go back to "Another Telltale Style Example" scene, It broke again.
I just tested going back and forth between scenes, and it works. There's nothing in the example that should depend on scene changes. What do you mean by line 4? The conversation has many different branches:

telltaleExampleConv.png
telltaleExampleConv.png (84.97 KiB) Viewed 902 times
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

Set DialogueManager.displaySettings.inputSettings.responseTimeout or DialogueManager.conversationView.displaySettings.inputSettings.responseTimeout.
But this is the global timeout,right? I mean a timeout that is overrided by "Override Display Settings" component or Conversation's Override Display Settings. I think the answer again lies in finding the target active conversation.
What do you mean by line 4?
I mean entry7, "This is NPC line 4". Perhaps the reason is my unity version? I am downloading the 2020.3.0LTS, I will try it later.
----------------------
I tried 2020.3.0LTS, Create a new project, Import DS, Import Another Telltale, Open it and works well, Open SampleScene, Open Another Telltale, Now entry7, "This is NPC line 4" doesn't show the Response Panel
If they involve different actors, you can check the active conversation record's actor and conversant transforms, or the conversationModel's actorInfo and conversantInfo.
Could you add a public field of the ActiveRecord to the Entry, it is set when start conversation. Then it is much easier to track in the event methods.

But an entry couldn't have 2 ActiveRecords if the same conversation started twice, So it will be great to have a instance option for a conversation, Like the Quest machine. And by this way we can keep the original entry Fields and modify instance's entry Fields like a temp Variable during the conversation.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

CHOPJZL wrote: Mon Mar 15, 2021 10:53 am
What do you mean by line 4?
I mean entry7, "This is NPC line 4". Perhaps the reason is my unity version? I am downloading the 2020.3.0LTS, I will try it later.
Let's put this off for now unless you need to get it working. I think it may distract us from what you actually want to do.
CHOPJZL wrote: Mon Mar 15, 2021 10:53 am
Set DialogueManager.displaySettings.inputSettings.responseTimeout or DialogueManager.conversationView.displaySettings.inputSettings.responseTimeout.
But this is the global timeout,right? I mean a timeout that is overrided by "Override Display Settings" component or Conversation's Override Display Settings. I think the answer again lies in finding the target active conversation.
In that case, find the active conversation record. It has a conversationView property. Set its displaySettings.
CHOPJZL wrote: Mon Mar 15, 2021 10:53 amCould you add a public field of the ActiveRecord to the Entry, it is set when start conversation. Then it is much easier to track in the event methods.
If I understand you correctly, that info is already there. It's in ActiveConversationRecord.conversationMode.firstState.subtitle.dialogueEntry.conversationID.
CHOPJZL wrote: Mon Mar 15, 2021 10:53 amBut an entry couldn't have 2 ActiveRecords if the same conversation started twice, So it will be great to have a instance option for a conversation, Like the Quest machine. And by this way we can keep the original entry Fields and modify instance's entry Fields like a temp Variable during the conversation.
In this case, you can keep track of each conversation yourself. As soon as the conversation has started, record its info. Example:

Code: Select all

Dictionary<int, ActiveConversationRecord> activeConversations;

void OnConversationStart(Transform actor)
{
    var conversationID = DialogueManager.lastConversationID;
    var numActiveConversations = DialogueManager.instance.activeConversations.Count;
    var record = DialogueManager.instance.activeConversations[numActiveConversations - 1];
    activeConversations[conversationID] = record;
}
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

If using conversationID, everytime I need to get a target record, I will need to loop to compare the entry's conversationID to the record's. It's much easier to just get it by entryX.record.

In your example it is impossible to track 2 conversations of the same conversationID

Instance is actually another case. I think it's a great feature to have for reusable conversations :)
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

What exactly do you need to track? The info is probably already there, and it's just a matter of tracking it.
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

In general I just want to track the ActiveConversationRecord. Mostly this will happen in Conversation Messages Events and the Paremeter is Subtitle or Responses, from which we can get Entry they belong to. So add a field to it is much more convenient than run a foreach loop to find it. My main purpose of this is to lower the matter to track ActiveConversationRecord.

Instance is actually another case. I think it's a great feature to have for reusable conversations
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

Each ActiveConversationRecord is already an instance. You don't have to use the example code with the Dictionary<> that I posted above.

Each ActiveConversationRecord already has the current entry. It's in ActiveConversationRecord.conversationController.currentState.
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: About Dialogue Actor component

Post by CHOPJZL »

You mistunderstood me.

It's not the current entry that I want to Track. It's the opposite. Use the entry to get Record. It is to find the DialogueUI, CurrentActor, or conversationController as the global ones are not accurate as we talked about before
As in OnConversationResponseMenu(Response[] responses), I need to use responses[0].destinationEntry
As in OnConversationLine(Subtitle subtitle), I need to use subtitle.dialogueEntry


Instance is actually another case. It's not instance of ActiveConversationRecord, but instance of a conversation in the database. Like the Quest Machine. If my understanding is right, it is different from "Instantiate Database"
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: About Dialogue Actor component

Post by Tony Li »

Hi,

CHOPJZL wrote: Mon Mar 15, 2021 8:34 pmIt's not the current entry that I want to Track. It's the opposite. Use the entry to get Record. It is to find the DialogueUI, CurrentActor, or conversationController as the global ones are not accurate as we talked about before
As in OnConversationResponseMenu(Response[] responses), I need to use responses[0].destinationEntry
As in OnConversationLine(Subtitle subtitle), I need to use subtitle.dialogueEntry
Thanks. I understand now. The Dialogue System doesn't work that way.

Would it help if the Subtitle object had a reference to its ActiveConversationRecord?

If not, here's an alternative:

Each active conversation has its model, view, and controller. It also points to actor and conversant GameObjects.

OnConversationLine() and OnConversationResponseMenu() are called on the actor and conversant GameObjects.

If you can assign a unique conversant GameObject to each conversation (even an empty GameObject), you can put your script on the conversant GameObject. This way you will know which one it is.
CHOPJZL wrote: Mon Mar 15, 2021 8:34 pmInstance is actually another case. It's not instance of ActiveConversationRecord, but instance of a conversation in the database. Like the Quest Machine. If my understanding is right, it is different from "Instantiate Database"
Quest Machine creates instances of quests, but the Dialogue System works differently. All conversations in the Dialogue System share the same dialogue database.

I have finished work for the day. I will check back in the morning.
Post Reply