Page 2 of 5

Re: start a simaltaneous conversation in an entry

Posted: Fri Feb 26, 2021 10:15 am
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?

Re: start a simaltaneous conversation in an entry

Posted: Fri Feb 26, 2021 10:41 am
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'.

Re: start a simaltaneous conversation in an entry

Posted: Fri Feb 26, 2021 11:06 am
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.

Re: start a simaltaneous conversation in an entry

Posted: Fri Feb 26, 2021 11:12 am
by Tony Li
The Dialogue System Extras page has a "Hover Response Button Example" that might be helpful.

Re: start a simaltaneous conversation in an entry

Posted: Fri Feb 26, 2021 8:43 pm
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

Re: start a simaltaneous conversation in an entry

Posted: Fri Feb 26, 2021 9:54 pm
by Tony Li
Hi,

You can already override things by writing an OnConversationResponseMenu() method or subclassing StandardUIMenuPanel and overriding ShowResponses().

Re: start a simaltaneous conversation in an entry

Posted: Fri Feb 26, 2021 10:25 pm
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?

Re: start a simaltaneous conversation in an entry

Posted: Sat Feb 27, 2021 8:31 am
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();
        }
    }
}

Re: start a simaltaneous conversation in an entry

Posted: Sat Feb 27, 2021 8:50 am
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.

Re: start a simaltaneous conversation in an entry

Posted: Sat Feb 27, 2021 9:02 am
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().