This script synchronizes a behavior tree's shared variables with the Dialogue System's Lua environment.
More...
|
static void | RegisterLuaFunctions () |
|
static void | bdSyncToLua (string gameObjectName) |
|
static void | bdSyncFromLua (string gameObjectName) |
|
static T | bdGetVariableValue< T > (string gameObjectName, string variableName, int group=-1) |
|
static void | bdSetVariableValue< T > (string gameObjectName, string variableName, T variableValue, int group=-1) |
|
static bool | bdGetBool (string gameObjectName, string variableName) |
|
static double | bdGetFloat (string gameObjectName, string variableName) |
|
static double | bdGetInt (string gameObjectName, string variableName) |
|
static string | bdGetString (string gameObjectName, string variableName) |
|
static void | bdSetBool (string gameObjectName, string variableName, bool variableValue) |
|
static void | bdSetFloat (string gameObjectName, string variableName, double variableValue) |
|
static void | bdSetInt (string gameObjectName, string variableName, double variableValue) |
|
static void | bdSetString (string gameObjectName, string variableName, string variableValue) |
|
static bool | bdGetBoolGroup (string gameObjectName, double group, string variableName) |
|
static double | bdGetFloatGroup (string gameObjectName, double group, string variableName) |
|
static double | bdGetIntGroup (string gameObjectName, double group, string variableName) |
|
static string | bdGetStringGroup (string gameObjectName, double group, string variableName) |
|
static void | bdSetBoolGroup (string gameObjectName, double group, string variableName, bool variableValue) |
|
static void | bdSetFloatGroup (string gameObjectName, double group, string variableName, double variableValue) |
|
static void | bdSetIntGroup (string gameObjectName, double group, string variableName, double variableValue) |
|
static void | bdSetStringGroup (string gameObjectName, double group, string variableName, string variableValue) |
|
static BehaviorTreeLuaBridge | FindBridge (string gameObjectName) |
|
static Behavior | FindBehavior (string gameObjectName, int group=-1) |
|
This script synchronizes a behavior tree's shared variables with the Dialogue System's Lua environment.
Attach it to the GameObject that contains the behavior tree. Synchronization occurs automatically at the beginning and end of conversations. You can also synchronize manually by calling SyncToLua() or SyncFromLua().
The Lua variables will have the name gameObjectName_variableName. All blank spaces and hyphens will be converted to underscores. For example, say an NPC named Private Hart has a behavior tree with a shared variable named Angry. The Lua variable will be Variable["Private_Hart_Angry"]
.
Only bools, floats, ints, and strings are synchronized.
This script also adds some Lua functions:
- bdSyncToLua(gameObject)
- bdSyncFromLua(gameObject) where gameObject is the name of a GameObject with a behavior tree.