Conversation does not match the variables? or conditions problem?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
LeonZhu
Posts: 3
Joined: Wed Jun 15, 2022 5:36 am

Conversation does not match the variables? or conditions problem?

Post by LeonZhu »

Hi
In the database, I have created a variable named "HP"; and some conversations.
And I use a dialogue trigger to start a bark action, the bark source are these conversations, bark order with random.
Then I give these conversations two kinds of conditions:
1: 30 < Variable["HP"] and Variable["HP"] <= 50, I call these conversations "kind A"
2: Variable["HP"] <= 30, I call these conversations "kind B"
I set "HP" with a float value when a button click. At this point I expect, when I set 30<"HP"<50, "kind A" conversations will be trigger, and when "HP"<30, "kind B" will be trigger.
But in I test demo, there are all random……In the case that I have checked the database with debug message and the variables are correct.
Image
Image
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversation does not match the variables? or conditions problem?

Post by Tony Li »

Hi,

If you're using a Dialogue System Trigger, did you tick Cache Bark Lines? If so, please untick it. This option ignores Conditions on dialogue entry nodes.
LeonZhu
Posts: 3
Joined: Wed Jun 15, 2022 5:36 am

Re: Conversation does not match the variables? or conditions problem?

Post by LeonZhu »

Tony Li wrote: Wed Jun 15, 2022 8:01 am Hi,

If you're using a Dialogue System Trigger, did you tick Cache Bark Lines? If so, please untick it. This option ignores Conditions on dialogue entry nodes.
HI

Thank you, but I haven't tick it....
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversation does not match the variables? or conditions problem?

Post by Tony Li »

Can you send a reproduction project to tony (at) pixelcrushers.com?

Here's an example scene that works correctly:

DS_BarkConditionsTest_2022-06-15.unitypackage
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversation does not match the variables? or conditions problem?

Post by Tony Li »

Thanks for sending the reproduction project.

The problem is that the button does not change the Lua variable value:

barkLua1.png
barkLua1.png (46.94 KiB) Viewed 365 times

Do not change the value in your dialogue database. Change the Lua value.

In C# or Visual Scripting, you can use DialogueLua.SetVariable() to set the Lua variable value. Example:

Code: Select all

DialogueLua.SetVariable("HP", 25);
Or you can configure a Dialogue System Trigger:

barkLua2.png
barkLua2.png (35.81 KiB) Viewed 365 times
Post Reply