Show node in different UI based on condition in custom script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
circusCharlie
Posts: 8
Joined: Thu Apr 29, 2021 1:48 pm

Show node in different UI based on condition in custom script

Post by circusCharlie »

Image

Hi I need some help. Kindly look into the image. As you can see at the end of every branch there is a different Feedback. I want to do 3 things:

1. Feedback should be displayed only if the "showFeedback" boolean is true in my custom script. How do I tell the dialogue manager to show/hide feedback node based on my boolean in the script?

2. Feedback should be shown on a completely different UI than the rest of the conversation.

3. Once the user has selected a branch and got feedback, that branch should get disabled (The reponse buttons should get set to interactable false) so that the next time this conversation is showed, the previously selected options are Greyed out/Uninteractable.


Sorry for the big set of problems. I am not sure how to achieve these. Please point me to the right direction. Thank you
User avatar
Tony Li
Posts: 21989
Joined: Thu Jul 18, 2013 1:27 pm

Re: Show node in different UI based on condition in custom script

Post by Tony Li »

Hi,
circusCharlie wrote: Mon Jun 21, 2021 11:54 am1. Feedback should be displayed only if the "showFeedback" boolean is true in my custom script. How do I tell the dialogue manager to show/hide feedback node based on my boolean in the script?
Register your script's method with Lua, and call it in the Conditions section. Relevant tutorials: Register Lua Tutorial, Conversation Conditions Tutorial.
circusCharlie wrote: Mon Jun 21, 2021 11:54 am2. Feedback should be shown on a completely different UI than the rest of the conversation.
The answer really depends on how different. You could set up an additional subtitle panel and assign it to the StandardDialogueUI's Conversation UI Elements > Subtitle Panels list. It will have an element number in the list (e.g., panel number 2). Then include a [panel=#] markup tag in the dialogue text to tell the text to use that panel.
circusCharlie wrote: Mon Jun 21, 2021 11:54 am3. Once the user has selected a branch and got feedback, that branch should get disabled (The reponse buttons should get set to interactable false) so that the next time this conversation is showed, the previously selected options are Greyed out/Uninteractable.
You could use SimStatus or a DS variable or your own script (registered with Lua) in the Conditions field. Set the Dialogue Manager's Input Settings > [em#] Tag for Invalid Responses. If you want to conditionally show some invalid responses but not others, see this post.
circusCharlie
Posts: 8
Joined: Thu Apr 29, 2021 1:48 pm

Re: Show node in different UI based on condition in custom script

Post by circusCharlie »

All the solutions that you proposed worked well. Thanks a lot for the great support.
User avatar
Tony Li
Posts: 21989
Joined: Thu Jul 18, 2013 1:27 pm

Re: Show node in different UI based on condition in custom script

Post by Tony Li »

Glad to help! :-)
Post Reply