Page 1 of 1

Putting unread dialogue option in Bold

Posted: Mon Apr 28, 2025 12:52 pm
by Matt_VoxPrima
Hello!

How would you go about to make an unread, unused dialogue choice written in bold characters, and having it in regular characters when it is "used" or spent or exhausted? So that the player knows what he's already interacted with and what is fresh and new in a dialogue branching hub.
Similar to classic CRPGs.

Re: Putting unread dialogue option in Bold

Posted: Mon Apr 28, 2025 1:09 pm
by Tony Li
Hi,

Normally you'd set the Dialogue Manager's Display Settings > Input Settings > [em#] Tag For Old Responses to something such as Em 1. Then in the Dialogue Editor's Database section > Database Properties > Emphasis Settings set the appearance of options that have already been selected (e.g., set to grayed out italic font).

However, in your case you want to change the appearance of options that haven't been selected. To do this, you'll need to add a script with an OnConversationResponseMenu() method to the Dialogue Manager. Something like:

Code: Select all

void OnConversationResponseMenu(Response[] responses)
{
    foreach (var response in responses)
    {
        var isNew = DialogueLua.GetSimStatus(response.destinationEntry) != DialogueLua.WasDisplayed;
        if (isNew) response.formattedText.text = $"<b>{response.formattedText.text}</b>";
    }
}
You can use this in combination with [em#1] Tag For Old Responses, too, if you want.

Re: Putting unread dialogue option in Bold

Posted: Mon Apr 28, 2025 1:30 pm
by Matt_VoxPrima
Oh I see!

I've added a script component to the dialogue manager and pasted your code in it but it created the following errors.
(I'm not a programmer '^^)

Re: Putting unread dialogue option in Bold

Posted: Mon Apr 28, 2025 2:52 pm
by Tony Li
Hi,

Try this:

DialogueChoiceBoldText.cs

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;

public class DialogueChoiceBoldText : MonoBehaviour
{
    void OnConversationResponseMenu(Response[] responses)
    {
        foreach (var response in responses)
        {
            var isNew = DialogueLua.GetSimStatus(response.destinationEntry) != DialogueLua.WasDisplayed;
            if (isNew) response.formattedText.text = $"<b>{response.formattedText.text}</b>";
        }
    }
}

Re: Putting unread dialogue option in Bold

Posted: Mon Apr 28, 2025 3:40 pm
by Matt_VoxPrima
Perfect! THank you so much!

Re: Putting unread dialogue option in Bold

Posted: Mon Apr 28, 2025 3:50 pm
by Tony Li
Glad to help!