Disable(Hide) response option based on condition

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Ekta Bhutwala
Posts: 40
Joined: Mon Sep 05, 2022 5:40 am

Disable(Hide) response option based on condition

Post by Ekta Bhutwala »

Hii..

I am doing Quest to find key of the door.

My story is like when i click on door first time, Quest is in Unassigned state. but after click on the door first time, conversation dialog is shown "This Room is locked and I need a key for this." and i am changing state of the quest to active.

Image i am attaching for whole tree.

Image

Here I have selected left side node which i want to execute when state is unassigned and right side node i want to execute when Quest become success.

I have added condition to check quest state on right side node also.

But it is showing me in response option in disable button form. where as i want to show only one dialog based on condition.

Thanks i hope i make you understand my problem.
Attachments
Screenshot 2022-09-22 183335.png
Screenshot 2022-09-22 183335.png (103.04 KiB) Viewed 376 times
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Disable(Hide) response option based on condition

Post by Tony Li »

Hi,

I will assume your quest's Name is "Get storeroom key".

In the left node, set Conditions to:

Code: Select all

CurrentQuestState("Get storeroom key") == "unassigned"
(You can use the "..." dropdown menus to do this; you don't have to type it manually if you don't want to.)

Set the left node's Script to:

Code: Select all

SetQuestState("Get storeroom key", "active")
---

In the right node, set Conditions to:

Code: Select all

CurrentQuestState("Get storeroom key") == "active"
Ekta Bhutwala
Posts: 40
Joined: Mon Sep 05, 2022 5:40 am

Re: Disable(Hide) response option based on condition

Post by Ekta Bhutwala »

Hii

But it's showing me both option with disable button. I don't want to show option who's condition does not get true (for this conversation only)
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Disable(Hide) response option based on condition

Post by Tony Li »

Hi,

Understood. Inspect the conversation in the Dialogue Editor. Select Menu > Conversation Properties. Tick Override Display Settings > Input Settings. Then leave the "Include Invalid Responses" checkbox unticked. This will only apply to this conversation.
Ekta Bhutwala
Posts: 40
Joined: Mon Sep 05, 2022 5:40 am

Re: Disable(Hide) response option based on condition

Post by Ekta Bhutwala »

Image

you can see the output. i don;t want to show second option whose condition is false right now
Attachments
Screenshot 2022-09-23 004742.png
Screenshot 2022-09-23 004742.png (92.83 KiB) Viewed 370 times
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Disable(Hide) response option based on condition

Post by Tony Li »

Make sure you're editing the correct database.

What are the Conditions on both nodes? Are they what I suggested above?
Ekta Bhutwala
Posts: 40
Joined: Mon Sep 05, 2022 5:40 am

Re: Disable(Hide) response option based on condition

Post by Ekta Bhutwala »

Yes sir. i checked twice. It's same as you said.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Disable(Hide) response option based on condition

Post by Tony Li »

Ekta Bhutwala
Posts: 40
Joined: Mon Sep 05, 2022 5:40 am

Re: Disable(Hide) response option based on condition

Post by Ekta Bhutwala »

Hello sir. Thanks for the demo. but it's showing me the same result. evenif override the input setting for conversation, showing invalid responses.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Disable(Hide) response option based on condition

Post by Tony Li »

In a clean project with just the Dialogue System and this example, this is what happens:

doorExample.png
doorExample.png (52.55 KiB) Viewed 353 times

Isn't that what you want to happen?

Notes:
  • The Dialogue Manager's Display Settings > Input Settings > Include Invalid Entries is TICKED.
  • The conversation's Override Display Settings > Input Settings > Include Invalid Entries is UNTICKED.
Post Reply