Syntax errors in Lua code in Behavior Designer integration

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
dancinggoat23
Posts: 29
Joined: Mon Mar 02, 2020 1:44 pm

Syntax errors in Lua code in Behavior Designer integration

Post 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.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Syntax errors in Lua code in Behavior Designer integration

Post 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 ~=.
dancinggoat23
Posts: 29
Joined: Mon Mar 02, 2020 1:44 pm

Re: Syntax errors in Lua code in Behavior Designer integration

Post by dancinggoat23 »

Ugh. I should've done more reading... Thank you Tony!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Syntax errors in Lua code in Behavior Designer integration

Post by Tony Li »

Glad to help!
Post Reply