Page 8 of 14

Re: About Dialogue Actor component

Posted: Mon Mar 15, 2021 9:45 pm
by CHOPJZL
Please feel free to rest after your work hour :D Actually this frees me from refresh the forum before 10 hours later :lol:

Setting empty conversant will cost the reuse feature, so I don't want to use it. Perhaps it will be much more useful when more than 2 Conversants are supported

I may had a great misunderstanding. Is it able to get an existing List of all Entries of the conversation in StartConversation() method of DialogueSystemController? Not a new generate one, but already exists before call StartConversation(). If there is not, then It's difficlut to modify the Entries, and my suggest's benefit becomes little.
Subtitle object had a reference to its ActiveConversationRecord?
Yes, This is a great help! Even better than my request. It even solves the "same conversationID conversations" problem.

And Response object should have it, too.

Quest Machine creates instances of quests, but the Dialogue System works differently. All conversations in the Dialogue System share the same dialogue database.
That's why I request this. For resuable conversations, duplicate it to a new one, In this way editing Entry's Fields will not affect the original one, and multiple conversations based on the same origin could have much more variety. It's not to change all the conversation into this way, but have an option when StartConversation.
------------
But this could be another over request of mine. I havn't thought it very deep. For now the specific result I want from this is to have a Fields only belong to the running conversation, and is able to be used in the Condition and Script of entry.

Re: About Dialogue Actor component

Posted: Tue Mar 16, 2021 9:11 am
by Tony Li
CHOPJZL wrote: Mon Mar 15, 2021 9:45 pmPlease feel free to rest after your work hour :D Actually this frees me from refresh the forum before 10 hours later :lol:
In your forum user profile, you can set up email notifications. User Control Panel > Board Preferences > Edit Notification Options.

Dialogue databases were not really designed to be changed at runtime, although you can still do it. Databases can be very large. If you duplicate the database for each active conversation, it will take more memory, and it may cause stutter while it's instantiating a new copy. I recommend finding a more standard solution for whatever you need to do. If you're not sure what to do, please explain your requirement for duplicating databases.

I'll add ActiveConversationRecord to Subtitle and Response by the end of tomorrow.

Re: About Dialogue Actor component

Posted: Tue Mar 16, 2021 10:17 am
by CHOPJZL
For now the specific result I want is to have a Fields only belong to the running conversation, and is able to be used in the Condition and Script of entry.

After a daytime thought, I understand duplicate a entire conversation is excessive. The real difference could happen in only several entries. (Of course I never thought about duplicate the database, or there is no way to duplicate in single conversation level?)

I considered about making a data manager outside DS. The biggest problem is how to get the specific data that belongs to the specific conversation record in a Registed Lua Function. I don't know what to put into the Function's parameter. Because this feature mostly happens when the same conversation started by multiple Dialogue Actors, So the conversationID is the same.

Re: About Dialogue Actor component

Posted: Tue Mar 16, 2021 1:18 pm
by Tony Li
If the conversation ID is the same but the actor IDs are different, then your C# method (Lua function) can tell them apart.

Re: About Dialogue Actor component

Posted: Tue Mar 16, 2021 7:54 pm
by CHOPJZL
What parameter should I use to put the actor&conversant IDs to Lua function?
-------------
I remembered, It's Actor[ Variable["ActorIndex"] ] ,Actor[ Variable["ConversantIndex"] ] .Is it safe if I use Variable["Actor"] directly?

And if No Dialogue Actor is used, the Conversant is set to the trigger

Re: About Dialogue Actor component

Posted: Tue Mar 16, 2021 8:17 pm
by Tony Li
To be safe, always use Variable["ActorIndex"] and Variable["ConversantIndex"] when you want to access an element of the Actor[] table, such as:

Actor[Variable["ActorIndex"]].Age

Variable["ActorIndex"] is an index in the Actor[] table.

Variable["Actor"] is the same actor's display name.

Examples:
  • Actor's Name in database is "Adam"
  • Actor's Display Name in database is not set
  • --> Variable["ActorIndex"] is "Adam"
  • --> Variable["Actor"] is "Adam"
---
  • Actor's Name in database is "Adam Smith"
  • Actor's Display Name in database is not set
  • --> Variable["ActorIndex"] is "Adam_Smith"
  • --> Variable["Actor"] is "Adam Smith"
---
  • Actor's Name in database is "Adam"
  • Actor's Display Name in database is "Adam Smith"
  • --> Variable["ActorIndex"] is "Adam"
  • --> Variable["Actor"] is "Adam Smith"

Re: About Dialogue Actor component

Posted: Tue Mar 16, 2021 8:43 pm
by CHOPJZL
Is the Variable["ActorIndex"] accurate?

If AAA and BBB start a conversation, then CCC and DDD start the same conversation, will them have a different Variable["ActorIndex"]?

Re: About Dialogue Actor component

Posted: Tue Mar 16, 2021 9:03 pm
by Tony Li
The Variable[] table is global, so Variable["ActorIndex"] will only be valid for the most recently started conversation.

If you need to save a variable for each conversation, you can do it in an OnConversationStart method. For example, you can maintain a table in C# of ActiveConversationRecords and their associated actor index and conversant index variables.

Re: About Dialogue Actor component

Posted: Tue Mar 16, 2021 9:08 pm
by CHOPJZL
The Variable[] table is global, so Variable["ActorIndex"] will only be valid for the most recently started conversation.
Does this means it is not accurate for normal simultaneous conversations, either?

Then how to use them in entry's Script and Condition?

Re: About Dialogue Actor component

Posted: Tue Mar 16, 2021 9:19 pm
by Tony Li
That's correct. It's always the value of the most recently started conversation. You should keep some other information and use that in your Script and Conditions.