Page 1 of 1

Custom False Condition Actions?

Posted: Thu Jun 05, 2025 4:10 am
by pixelemm
Hi,

I was wondering if I can create a custom false condition action.

What I would like to happen is if a response entry does not meet the condition, rather than showing the menu text, I would like it to show "????". I understand that I can show invalid response entries but I would also like to change its text if its invalid.

I've taken a look at the extra examples project but I'm still not sure where/how I should go about changing the text. I also noticed that in the example, invalid responses are red. How would I go about changing this to be greyed out?

Would greatly appreciate the help :D

Re: Custom False Condition Actions?

Posted: Thu Jun 05, 2025 7:53 am
by Tony Li
Hi,

1. Tick the Dialogue Manager's Display Settings > Input Settings > Show Invalid Entries. This will show responses whose Conditions are false. They'll be on non-interactable response buttons.

2. Add a script with an OnConversationResponseMenu() method to the Dialogue Manager, something like:

Code: Select all

void OnConversationResponseMenu(Response[] responses)
{
    foreach (Response response in responses)
    {
        // Change the button text of all responses whose Conditions are false:
        if (!response.enabled) response.formattedText.text = "????";
    }
}

Re: Custom False Condition Actions?

Posted: Thu Jun 05, 2025 10:26 pm
by pixelemm
Ah I see! Thanks Tony!

Re: Custom False Condition Actions?

Posted: Thu Jun 05, 2025 10:51 pm
by Tony Li
Glad to help!