PixelCrushers.DialogueSystem.BehaviorDesigner.BehaviorTreeLuaBridge Class Reference

This script synchronizes a behavior tree's shared variables with the Dialogue System's Lua environment. More...

Inheritance diagram for PixelCrushers.DialogueSystem.BehaviorDesigner.BehaviorTreeLuaBridge:
Collaboration diagram for PixelCrushers.DialogueSystem.BehaviorDesigner.BehaviorTreeLuaBridge:

Public Member Functions

void OnConversationStart (Transform actor)
 When a conversation starts, sync to Lua. More...
 
void OnConversationEnd (Transform actor)
 When a conversation ends, sync from Lua back into the behavior tree. More...
 
void SyncToLua ()
 Syncs the behavior tree's shared variables to the Dialogue System's Lua environment. More...
 
void SyncFromLua ()
 Syncs the Dialogue System's Lua environment back into the behavior tree's shared variables. More...
 

Detailed Description

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.

Member Function Documentation

◆ OnConversationEnd()

void PixelCrushers.DialogueSystem.BehaviorDesigner.BehaviorTreeLuaBridge.OnConversationEnd ( Transform  actor)

When a conversation ends, sync from Lua back into the behavior tree.

If the conversation has changed any values, the changes will be reflected in the behavior tree.

Parameters
actorThe other actor.

◆ OnConversationStart()

void PixelCrushers.DialogueSystem.BehaviorDesigner.BehaviorTreeLuaBridge.OnConversationStart ( Transform  actor)

When a conversation starts, sync to Lua.

This makes the behavior tree data available to conversations in Conditions and User Scripts.

Parameters
actorThe other actor.

◆ SyncFromLua()

void PixelCrushers.DialogueSystem.BehaviorDesigner.BehaviorTreeLuaBridge.SyncFromLua ( )

Syncs the Dialogue System's Lua environment back into the behavior tree's shared variables.

◆ SyncToLua()

void PixelCrushers.DialogueSystem.BehaviorDesigner.BehaviorTreeLuaBridge.SyncToLua ( )

Syncs the behavior tree's shared variables to the Dialogue System's Lua environment.


The documentation for this class was generated from the following file: