How to format & disable responses based on variables/quest states?

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to format & disable responses based on variables/quest states?

Post by Tony Li »

Hi,

A quick solution might be to untick the Dialogue Manager's Subtitle Settings > Rich Text Emphases tag. When this is unticked, only the last-applied emphasis takes effect, and it takes effect for the entire text. Since the invalid response tag gets applied last, it will take precedence over the pink Em3 tag.

Note that this isn't a good solution if you're applying tags to only part of the text, such as:

Hulk [em4]SMASH[/em4]!

If that's the case, let me know and I'll reply with a different suggestion.
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: How to format & disable responses based on variables/quest states?

Post by Abelius »

Oh, that did the trick! :mrgreen:

And yeah, I don't need partially formatted text there, so it's good enough for me.

The only thing that could be improved is that when the response is invalid, although it gets colored with the selected invalid Em tag, I can still hover it and it gets highlighted. And I think that didn't happened with the 'Rich Text Emphases' ticked.

It's a minor issue though!

Thank you for your quick reply!
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to format & disable responses based on variables/quest states?

Post by Tony Li »

Hmm, I wonder if something else changed in your project. In my test scene, the invalid responses remain unhoverable:

ShowInvalidResponsesExample_2017-11-04.unitypackage

I built the scene in Unity 5.6.0, but I think it should import fine into 5.5.0.

Update 2017-11-12: ShowInvalidResponsesExample_2017-11-12.unitypackage (see here).
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: How to format & disable responses based on variables/quest states?

Post by Abelius »

Hello Tony, long time no see! :)

Sorry for necroing my own thread, but I guess it'll be the best option to stay on topic and don't duplicate.

I'm making a different game, and I wanted to add this "Show Invalid" field again, so I've downloaded the above script.

To the best of my understanding, I only needed to modify from where it inherits (StandardDialogueUI now). Then I added both "Show Invalid" and "Show Conditions" fields that I've seen inside the script.

Now... what I don't know what it does is that "Show Conditions" field. :?

Image

I didn't have it before. Maybe I was using the previous script version, I don't know.

So my only question is what it does. Does it need to be also true for an invalid entry being displayed or something?

Thanks!
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: How to format & disable responses based on variables/quest states?

Post by Abelius »

Hi again,

After experimenting a little, I don't think the script is hiding invalid entries on its own.

They always show up when 'Include Invalid Entries' is checked in the Dialogue Manager Input Settings, regardless of having set a specific invalid entry "Show Invalid" field as true.

I also set that "Show Conditions" field to true and false and it didn't make a difference. So, I guess it would need to be modified for my version of DS (2.2.5 atm).

I really gonna need this feature of selectively showing invalid entries. Could you do me the huge favor of revising that code, please?

Or if you think I might do something wrong, I'm here to troubleshoot.

Thank you!
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: How to format & disable responses based on variables/quest states?

Post by Abelius »

And hello again! :lol:

It's working now. Sorry for the triple post.

What I've done is to use the initial script, without the "Show Conditions" field, which you explained here...:

https://www.pixelcrushers.com/phpbb/vie ... alid#p6114

...it's redundant. And now it's working as it was in my previous project.

Forgive me if I've made you lose your time, and thank you for your still awesome plugin and support. ;)
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to format & disable responses based on variables/quest states?

Post by Tony Li »

Hi!

Glad you got it all working. :-)
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: How to format & disable responses based on variables/quest states?

Post by Abelius »

Hi Tony,

Sorry for necroing this... again! :roll: But I guess it's better, so all of this is in one place.

So, I'm having the same issue of emphasis tags taking precedence over the invalid tag, which I'm interested in being the one being applied when a condidion is not met.

But this time I'm using TMP text components, and the solution of unchecking "Use Rich Text For [em#] Tags" doesn't seem to work in this case. It results in this...:

Image

[em2] is the Invalid Response tag, while 5 and 6 are set manually in those entries.

So, what could I do for invalid tags being applied over the "manual" tags?

Thanks!
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to format & disable responses based on variables/quest states?

Post by Tony Li »

Hi,

Good point. The Invalid Response appearance should take precedence. I'll post a patch here later today.
Post Reply