Page 1 of 1

How to emphasis not optional responses

Posted: Thu Oct 19, 2023 4:35 pm
by wborgo
Hi, I found here in the forum by the search that I can use emphasis and SimStatus to darken the responses that the player already chosed before.

Now I want to emphasis the "not optional" responses. I know how to configure the em1, em2, em3 and em 4 in the database settings.
There is 2 scenarios:
1 - I have only 1 primary response (and it´s the first one)
2 - I have some cases that I want to mark more than one main response (the case where the player can choose the path)
3 - in some cases, I can have both optional and not optional responses (more than 1 main responses + optional)

The main goal is to have something like in cyberpunk, where you have more than 1 main choices and optional dialogs together
Image

A second question, the optional responses needs to get back to the responses menu, I achieved this by creating an empty dialog with "Auto click Continue" sequence, and then linking the last dialog back to that empty dialog (as shown in the print bellow).

Is there a "oficial" way to do this whithout the empty response?
Captura de tela 2023-10-19 173419.png
Captura de tela 2023-10-19 173419.png (102.66 KiB) Viewed 287 times

Re: How to emphasis not optional responses

Posted: Thu Oct 19, 2023 4:53 pm
by wborgo
For the emphasis, I fond the markup tag:
[em#]...[/em#] (Emphasis) Apply an emphasis setting to the text. Set emphasis appearances on the Database tab.

Is there an "ot of the box" way to do this?

Re: How to emphasis not optional responses

Posted: Thu Oct 19, 2023 5:22 pm
by Tony Li
Hi,

At some point, you need to specify that a response is a primary response and not an optional response. If you want to automate this more, instead of manually adding [em#]...[/em#] to your text, you could add a custom field to your dialogue entry template. For example, add a Boolean field named Primary. Set it true for primary responses and false for optional responses.

primaryField.png
primaryField.png (48.09 KiB) Viewed 284 times

Then add a script with an OnConversationResponseMenu(Response[] responses) method to the Dialogue Manager GameObject. In this method, check each response's destinationEntry. If it's a primary response, add [em#] tags. Something like:

Code: Select all

void OnConversationResponseMenu(Response[] responses)
{
    foreach (Response response in responses)
    {
        bool isPrimary = Field.LookupBool(response.destinationEntry.fields, "Primary");
        if (isPrimary)
        {
            response.formattedText.text = $"[em1]{response.formattedText.text}[/em1]";
        }
    }
}

Re: How to emphasis not optional responses

Posted: Thu Oct 19, 2023 5:34 pm
by wborgo
This makes sense, thank you!

Re: How to emphasis not optional responses

Posted: Thu Oct 19, 2023 9:19 pm
by Tony Li
Glad to help!