Behavior Tree Lua Bridge
Posted: Sat Nov 15, 2014 10:43 am
I’ve successfully set up Third Party Support for Behavior Tree, and I’ve just been testing it out. The Behavior Designer Sequencer Commands work, but I’m having trouble working with the Behavior Tree Lua Bridge.
I have a shared bool in my Behavior Designer tree called “PurpleFactor”, which I’m hoping to access in lua. The behavior tree is on game object “Character 5”, which, when it encounters the Player, starts a conversation in Dialogue Manager.
The Character 5 game object, in addition to having the Behavior tree script, now has the Lua Bridge script on it as well. My understanding is that that script should create variable “Character_5_PurpleFactor” in Dialogue Manager.
Testing through the lua console returns ‘nil’ however, and I also tried manually calling SyncToLua() in both BD and DS, but that throws this console error:
Dialogue System: Lua code 'SyncToLua()' threw exception 'Invoke function call on non function value.'
which, I suppose means there’s no such function, and makes me wonder if there’s an error in that script. It’s possible, though, that I’ve somehow set up the DialogueDatabase wrong, although whether ‘Sync Variables’ is checked or unchecked doesn’t affect the outcome.
Does anyone have any ideas what could be happening? Do I need to create a variable in my database for this to work?
I have a shared bool in my Behavior Designer tree called “PurpleFactor”, which I’m hoping to access in lua. The behavior tree is on game object “Character 5”, which, when it encounters the Player, starts a conversation in Dialogue Manager.
The Character 5 game object, in addition to having the Behavior tree script, now has the Lua Bridge script on it as well. My understanding is that that script should create variable “Character_5_PurpleFactor” in Dialogue Manager.
Testing through the lua console returns ‘nil’ however, and I also tried manually calling SyncToLua() in both BD and DS, but that throws this console error:
Dialogue System: Lua code 'SyncToLua()' threw exception 'Invoke function call on non function value.'
which, I suppose means there’s no such function, and makes me wonder if there’s an error in that script. It’s possible, though, that I’ve somehow set up the DialogueDatabase wrong, although whether ‘Sync Variables’ is checked or unchecked doesn’t affect the outcome.
Does anyone have any ideas what could be happening? Do I need to create a variable in my database for this to work?