Page 1 of 1

Conversation does not match the variables? or conditions problem?

Posted: Wed Jun 15, 2022 6:16 am
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

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

Posted: Wed Jun 15, 2022 8:01 am
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.

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

Posted: Wed Jun 15, 2022 9:14 am
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....

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

Posted: Wed Jun 15, 2022 9:22 am
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

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

Posted: Wed Jun 15, 2022 3:14 pm
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 364 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 364 times