Conditions not working for some reason

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
andreasr
Posts: 8
Joined: Mon Oct 12, 2020 7:58 pm

Conditions not working for some reason

Post by andreasr »

Hey Tony, hope you're doing well.

I was building out a dialogue tree for a new project using sets of randomValue = math.Random(100) and conditions for percent chances of going down various forks when I realized my conditions weren't working properly. I now have changed part of it for testing, setting randomValue to 77, then a spacer node with None(), then a set of nodes with conditions: <= 35, <35 and >= 65, etc). Regardless of what I set randomValue to, the conversation goes to the first node with condition randomValue <= 35, even though I'm checking watches and seeing it is in fact set to 77. Any ideas would be appreciated, thanks!
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conditions not working for some reason

Post by Tony Li »

Hi,

If you temporarily set the Dialogue Manager's Other Settings > Debug Level to Info, it will log details to the Console window. Are the other nodes logging as "Add Link" (indicating their Conditions are true) or "Block On False Link" (indicating their Conditions are false)?
andreasr
Posts: 8
Joined: Mon Oct 12, 2020 7:58 pm

Re: Conditions not working for some reason

Post by andreasr »

So, the other 3 nodes, including the one with (randomValue > 65 and randomValue <= 85) that that should be where the convo goes, are all showing Block on False Link.

The 1st node is logging Add Link.. but I noticed it isn't checking a condition, it just has (true) at the end, even though there is a condition. Uploading a screenshot. Can't show it all in one, but on Watches randomValue is definitely 77.
Attachments
Screen Shot 2023-03-11 at 2.25.54 PM.png
Screen Shot 2023-03-11 at 2.25.54 PM.png (952.74 KiB) Viewed 375 times
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conditions not working for some reason

Post by Tony Li »

Hi,

It looks like your Dialogue System installation may be broken. Are the Editor Default Resources and Gizmos folders in place? They're Unity special folders that must be in the root Assets folder.

Make sure your Dialogue Manager's Initial Database field points to the database that you're editing. Sometimes folks accidentally start editing the Auto-Backup copy of the database, or assign it to the Dialogue Manager. Also make sure you're playing the conversation that you're editing and a duplicate.
andreasr
Posts: 8
Joined: Mon Oct 12, 2020 7:58 pm

Re: Conditions not working for some reason

Post by andreasr »

Yeah, I'm definitely working with the correct conversation and database, and Dialogue Manager is pointing to it.

The Gizmos and Editor Default Resources folder are both in root Assets, thought they both appear to just have .png icons in them.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conditions not working for some reason

Post by Tony Li »

Strange that the red question mark icon doesn't appear on nodes that have Conditions.

Would it be possible for you to send a reproduction project to tony (at) pixelcrushers.com?
andreasr
Posts: 8
Joined: Mon Oct 12, 2020 7:58 pm

Re: Conditions not working for some reason

Post by andreasr »

Oh they do, I was just zoomed out enough when I took the screenshot that all those icons were invisible. Yes, I'll send over the project, thanks.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conditions not working for some reason

Post by Tony Li »

Thanks for sending the project. To recap, the <START> node was setting a "local" variable named randomValue, which is a different variable from Variable["randomValue"] that was being checked in later nodes' Conditions.
Post Reply