start a simaltaneous conversation in an entry

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

Re: start a simaltaneous conversation in an entry

Post by CHOPJZL »

I come up with an idea about the loops. In the custom sequencer command that run the loop, use DialogueManager.PlaySequence("AAA(); BBB()") as the loop body, then I can loop any commands I want. The group message can use this idea too. It will be better if there is a way to pass the contidion as a parameter into the custom command

I have some other questions,

1. How to add my custom response item? It may not be a button of text, but a button prefab with sprite only.

2. The subject parameter of command needs the name of gameObject in the scene, not the actor name in the "Actors" of the database, am I right?
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: start a simaltaneous conversation in an entry

Post by Tony Li »

CHOPJZL wrote: Fri Feb 26, 2021 10:15 am1. How to add my custom response item? It may not be a button of text, but a button prefab with sprite only.
If you use TextMesh Pro, you can use a <sprite> tag to show a sprite in the text.
CHOPJZL wrote: Fri Feb 26, 2021 10:15 am2. The subject parameter of command needs the name of gameObject in the scene, not the actor name in the "Actors" of the database, am I right?
Yes. It must be the name of a GameObject in the scene or the special keywords 'speaker' or 'listener'.
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: start a simaltaneous conversation in an entry

Post by CHOPJZL »

How about a more complex prefab that has its own logic. For example, in Disco Elysium, when hover on a selection that requires player's certain skill level, a UI panal will show up to tell us the player's recent skill level and the gap between. This maybe able to achieve if I write some status in the menu text, but what if there is only a sprite.

So I wonder if there is a way to use not the Response Button Template, but instantiate certain prefab for selection, and selectionA and selectionB could be complete different prefabs.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: start a simaltaneous conversation in an entry

Post by Tony Li »

The Dialogue System Extras page has a "Hover Response Button Example" that might be helpful.
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: start a simaltaneous conversation in an entry

Post by CHOPJZL »

I got it, I can add custom fields to do more things.

If possible, I still want to suggest to add a override response template in the dialogue entry to get more flexibility, I thought about instantiating a custom prefab assigned by custom field to replace the template, but it may need to repeat a lot of initializion, and can't compare to instantiating the desired prefab at the beginning
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: start a simaltaneous conversation in an entry

Post by Tony Li »

Hi,

You can already override things by writing an OnConversationResponseMenu() method or subclassing StandardUIMenuPanel and overriding ShowResponses().
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: start a simaltaneous conversation in an entry

Post by CHOPJZL »

I think I understand how to do it by ShowResponses(), could you explain more about the OnConversationResponseMenu() way?

And is there any usecase wo show howto use "Files" Field type?
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: start a simaltaneous conversation in an entry

Post by Tony Li »

There's not much use for the "Files" type. It's a remnant from Chat Mapper. It's just a string. Typically is contains content such as "[filename; filename; filename;...]" but the Dialogue System doesn't do anything special with this string.

The Dialogue System calls OnConversationResponseMenu() before showing the menu. In the method, you can change the content of each of the Response objects in the array (but you can't resize the array) and/or do other things such as checking the destination entries' field values.

For example, say you want to play a special sound if any of the responses has a Boolean field "Special" that's set to true. You could add this method to a script on the Dialogue Manager:

Code: Select all

void OnConversationResponseMenu(Response[] responses)
{
    foreach (Response response in responses)
    {
        if (Field.LookupBool(response.destinationEntry.fields, "Special") == true)
        {
            PlaySpecialSound();
        }
    }
}
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: start a simaltaneous conversation in an entry

Post by CHOPJZL »

But how to use OnConversationResponseMenu() to replace the response prefab of certain entry? I know if I subclass StandardUIMenuPanel, then I can overriding ShowResponses() to use a custom InstantiateButton() method. But OnConversationResponseMenu() is before the instantiation.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: start a simaltaneous conversation in an entry

Post by Tony Li »

To replace the response button prefab, use ShowResponses(). If you want to show an additional prefab (not replace the button) and you don't want to create a subclass of StandardUIMenuPanel, you can use OnConversationResponseMenu().
Post Reply