Page 1 of 1

Syntax errors in Lua code in Behavior Designer integration

Posted: Mon Feb 22, 2021 3:22 pm
by dancinggoat23
Hello

I am building a Behavior Designer tree and am using the Dialogue System integration. At the start of a behavior sequence, I'm testing a Lua variable. However, Lua is reporting syntax errors in this code. I can't find anything wrong with it; am I missing something?

Code: Select all

Variable["GrandmotherSpidermet"] != true
The variable is defined in DS; I've confirmed that DS works with this setup as BD tasks can start conversations with no problem. I tried tracing into the Lua interpreter, and it *seems* as if the "!=" operator isn't being parsed, though I could be wrong about that.

Re: Syntax errors in Lua code in Behavior Designer integration

Posted: Mon Feb 22, 2021 3:43 pm
by Tony Li
Hi,

Use ~= instead of ~=.

There are a small handful of differences like this between Lua and C#, shown in this table.

Where available (e.g., in dialogue entry nodes' Conditions and Script fields), use the "..." dropdown wizard so you don't have to type the variable name or ~=.

Re: Syntax errors in Lua code in Behavior Designer integration

Posted: Mon Feb 22, 2021 3:58 pm
by dancinggoat23
Ugh. I should've done more reading... Thank you Tony!

Re: Syntax errors in Lua code in Behavior Designer integration

Posted: Mon Feb 22, 2021 3:59 pm
by Tony Li
Glad to help!