Dynamic formatting response menu entries

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
irve
Posts: 53
Joined: Fri Jan 15, 2016 9:35 am

Dynamic formatting response menu entries

Post by irve »

I'm trying to do automatic re-colouring and numbering of response entries using OnConversationResponseMenu, which sometimes causes some specific responses to be parsed twice, which in turn results in numbering being there twice (I think it's Articy condition nodes which transform into {group} nodes ).

The current hack is that I'm detecting the formatted one, but I started to wonder, if there was a more straightforward solution. I suppose I could do numbering in response buttons panel to guarantee that they stay correct, but I think I still need to include imminent skillcheck information dynamically.

(feel free to answer after releasing the new version: not in a hurry ;))
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dynamic formatting response menu entries

Post by Tony Li »

Hi,

The Unity UI Dialogue UI has built-in auto-numbering. Just tick Response Menu > Autonumber.

If you need to manipulate and reparse the response text, you could do something like this:

Code: Select all

foreach (var response in responses) {
    var myManipulatedText = ManipulateText(response.destinationEntry.MenuText);
    response.formattedText = FormattedText.Parse(myManipulatedText, DialogueManager.MasterDatabase.emphasisSettings);
} 
If I missed the point of what you're trying to do, please provide some more details or an example. Or feel free to send an example to tony (at) pixelcrushers.com. I'll be happy to take a look!
irve
Posts: 53
Joined: Fri Jan 15, 2016 9:35 am

Re: Dynamic formatting response menu entries

Post by irve »

Thanks. Getting them from the source does it for us, but auto-numbers were also a helpful hint since they already have hotkeys set up.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dynamic formatting response menu entries

Post by Tony Li »

Great! Glad I could help!
Post Reply