Custom False Condition Actions?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
pixelemm
Posts: 8
Joined: Fri Jul 19, 2024 2:48 am

Custom False Condition Actions?

Post 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
User avatar
Tony Li
Posts: 23259
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom False Condition Actions?

Post 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 = "????";
    }
}
pixelemm
Posts: 8
Joined: Fri Jul 19, 2024 2:48 am

Re: Custom False Condition Actions?

Post by pixelemm »

Ah I see! Thanks Tony!
User avatar
Tony Li
Posts: 23259
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom False Condition Actions?

Post by Tony Li »

Glad to help!
Post Reply