Page 1 of 1

Variable Bool States on Start

Posted: Tue Mar 06, 2018 9:26 pm
by nathanj
Hi Again,

I'm trying to set up some Boolean variables to control dialogue conditions but it's like the boolean state is not recognised by Dialogue System on Start.

For example, I have a conversation that requires the Boolean state to be false. I have the Variable "bleeding" set to false in the editor but when I play and try the dialogue trigger nothing happens. However, if I set the variable's state to false through a trigger in game the aforementioned conversation trigger works and the conversation is allowed to proceed.

Is there something I am doing wrong this setup?

Image

Image


Thanks,

Nathan

Re: Variable Bool States on Start

Posted: Tue Mar 06, 2018 11:29 pm
by Tony Li
Hi Nathan,

Did you put the condition on the <START> node? Conditions on <START> nodes aren't observed. Instead, put it on the first node coming off the <START> node, or put it on the trigger itself. The Conversation Trigger, for example, has a Condition section. You can put the condition in Condition > Lua Conditions. The trigger won't allow itself to be triggered if the condition is false.

(I'm finishing up work for the night, but I'll check back in the morning.)

Re: Variable Bool States on Start

Posted: Wed Mar 07, 2018 12:26 am
by nathanj
Hey Tony,

The condition was on a conversation node, not on the <Start> node. I see the confusion. I just meant when the game starts the variables levels don't seem to be recognised by Dialogue System.

I have three Booleans set: "Poison" "Bleeding" and "Sick". They are all set to False in the editor. Some of the NPCs have group nodes that determine if any of these are set to true. If they are it determines what conversation follows, if all of them are false then the regular conversation proceeds.

The issue is that when the game starts none of the conversations are available (neither the true or false conditions are recognised). However, if I add a Dialogue System Trigger to the scene, have it trigger "On Start", assign 0 conditions and set the Action "Run Lua Code" to set the three boolean values to false everything works as expected.

Is there anywhere else Boolean settings need to be assigned so they're recognised On Start?

Thanks again.

Nathan

Re: Variable Bool States on Start

Posted: Wed Mar 07, 2018 10:04 am
by Tony Li
Hi Nathan,

Is the dialogue database that contains those variables assigned to the Dialogue Manager. I've been known to accidentally assign the wrong dialogue database and then scratch my head for a minute to figure out why the Dialogue System isn't seeing everything that I thought I had defined.

You can check what's getting loaded by temporarily setting the Dialogue System's Debug Level to Info. This will log a lot of info to the console. Somewhere in all that info you should see a line that looks similar to:

Code: Select all

Variable = { Alert="", Poison=false, Bleeding=false, ...

Re: Variable Bool States on Start

Posted: Wed Mar 07, 2018 6:13 pm
by nathanj
Hey Tony

The correct Database is set and when "Info" is selected from the Database I get these messages that suggest it's working correctly, except it's not.

Image

and when the conversation is selected this appears

Image

However, as I mentioned before, if I manually assign the Boolean values to False with the Dialogue System Trigger (set to trigger On Start with no conditions) everything works as expected. Which is fine, really. I just can't figure out why the values are not being recognised on start.

Anyways, I'm sorry to take up so much time of your with this menial issue. There's n need to respond, I'm just explaining the settings.

Nathan

Re: Variable Bool States on Start

Posted: Wed Mar 07, 2018 7:47 pm
by Tony Li
Hi Nathan,

I'm going to follow up on this if you have the time because I want to make sure nothing truly bad is going on. Please reply at your convenience if you're so inclined.

With Debug Level set to Info, the Variable["Bleeding"] = false, etc., initialization lines appear before the conversation lines, right? I just want to confirm that things are happening in the correct order.

Before starting the conversation (if you have time), would you please:

1. Open the Dialogue Editor window while the game is running, and go to the Templates tab.

2. Select Menu > Add All Runtime Variables.

3. Select Menu > Add Watch. Paste in the condition:

Code: Select all

(Variable["Bleeding"] == false) and (Variable["Poison"] == false) and (Variable["Sick"] == false)
Are the values of individual variables and the condition what you expect?

Re: Variable Bool States on Start

Posted: Wed Mar 07, 2018 8:40 pm
by nathanj
Hey Tony

I didn't know about the Watch/Templates tab. This is very useful.

I'm a little confused as to what's going on. I'm sorry if it's something I did and unaware of, I just can't think of what it is.

If I disable the Dialogue System Trigger (that was setting the states to false) and set the Boolean values to true, when I start the game two of the values change to true and then to false quickly (which make me think that this is something in my scene), while the other value remains at false.

I'm trying to get some stuff done for this afternoon but I'll try with a new build tomorrow and let you know what happens. I'll use all the DS components and Extras I have.

I'll keep you posted.

Thanks for all your help.

Nathan

Re: Variable Bool States on Start

Posted: Wed Mar 07, 2018 9:34 pm
by Tony Li
It sounds like another Dialogue System Trigger or Lua Trigger or custom script may be setting some variables to true when they start. But if the Dialogue System Trigger workaround works and you run out of time, I'd say just leave it in so you can focus on more pressing issues. Any time you want to revisit the issue, just let me know.

Re: Variable Bool States on Start

Posted: Wed Mar 07, 2018 10:31 pm
by nathanj
Ugh, I'm so sorry Tony, I found the issue.

My colleague is working on an integration system for DS and Ultimate Survival. Yesterday he set up a system for linking boolean variables between the two systems, essentially turning DS variables into mirrors of those within the US system. I should have realised this but just had a complete brain fart.

I'm so sorry for wasting your time, again.

Thank you
Nathan

Re: Variable Bool States on Start

Posted: Thu Mar 08, 2018 8:48 am
by Tony Li
No worries! Thanks for letting me know. I always feel better when we get to the bottom of a puzzle.