PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge Class Reference

This component synchronizes Adventure Creator data with Dialogue System data. More...

Inheritance diagram for PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge:
Collaboration diagram for PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge:

Classes

class  SyncSettings
 

Public Member Functions

virtual void Start ()
 
virtual void OnConversationStart (Transform actor)
 Prepares to run a conversation by freezing AC and syncing data to Lua.
 
virtual void OnConversationEnd (Transform actor)
 At the end of a conversation, unfreezes AC and syncs Lua back to AC.
 
virtual void SetConversationGameState ()
 Sets GameState to DialogOptions if specified in the properties.
 
virtual void UnsetConversationGameState ()
 Restores the previous GameState if necessary.
 
void SetGameStateToCutscene ()
 Sets AC's GameState to DialogOptions.
 
void RestorePreviousGameState ()
 
void DisableACCameraControl ()
 
void EnableACCameraControl ()
 
void IdleACCameraControl ()
 
void SetConversationCursor ()
 Sets the conversation cursor.
 
void RestorePreviousCursor ()
 Restores the previous cursor.
 
virtual void SyncAdventureCreatorToLua ()
 Syncs the AC data to Lua.
 
virtual void SyncLuaToAdventureCreator ()
 Syncs Lua back to AC data.
 
void SyncVariablesToLua ()
 
void SyncLuaToVariables ()
 
void SyncInventoryToLua ()
 Syncs AC's inventory to Lua.
 
void SyncLuaToInventory ()
 Syncs Lua to AC's inventory.
 
void GenerateAdventureCreatorLipsyncLines ()
 

Static Public Member Functions

static void SaveDialogueSystemToGlobalVariable ()
 Saves the Dialogue System state to a dedicated AC global variable.
 
static void LoadDialogueSystemFromGlobalVariable ()
 Loads the Dialogue System state from a dedicated AC global variable.
 
static void UpdateSettingsFromAC ()
 
static bool acGetBoolean (string variableName)
 
static double acGetInteger (string variableName)
 
static double acGetFloat (string variableName)
 
static string acGetText (string variableName)
 
static void acSetBoolean (string variableName, bool value)
 
static void acSetInteger (string variableName, double value)
 
static void acSetFloat (string variableName, double value)
 
static void acSetText (string variableName, string value)
 
static bool acGetBooleanOnGO (string goName, string variableName)
 
static double acGetIntegerOnGO (string goName, string variableName)
 
static double acGetFloatOnGO (string goName, string variableName)
 
static string acGetTextOnGO (string goName, string variableName)
 
static void acSetBooleanOnGO (string goName, string variableName, bool value)
 
static void acSetIntegerOnGO (string goName, string variableName, double value)
 
static void acSetFloatOnGO (string goName, string variableName, double value)
 
static void acSetTextOnGO (string goName, string variableName, string value)
 
static double acGetItemCount (string itemName)
 
static void acSetItemCount (string itemName, double value)
 
static void acIncItemCount (string itemName, double value)
 
static string acGetObjectiveState (double objID, string playerName)
 

Public Attributes

UseDialogState useDialogState = UseDialogState.IfPlayerInvolved
 The AC GameState to use when in conversations.
 
UseDialogState takeCameraControl = UseDialogState.IfPlayerInvolved
 Specifies when conversations should take camera control.
 
float maxTimeToWaitForCameraStop = 10f
 The max time to wait for the camera stop if takeCameraControl is AfterStopIfPlayerInvolved.
 
bool forceCursorVisibleDuringConversations = true
 
SyncSettings syncSettings = new SyncSettings()
 
bool includeSimStatus = false
 Set true to include dialogue entry status (offered and/or spoken) in save data.
 
bool prependGlobalVariables = false
 Set true to prepend 'global_' in front of global AC variables in Dialogue System's Variable[] table.
 
bool saveToGlobalVariableOnConversationEnd = false
 Set true to save the Lua environment to the AC global variable when conversations end.
 
bool rerunScriptAfterCutscenes = false
 Set true to resolve race conditions between AC() sequencer command and Lua Script on subsequent dialogue entry.
 
bool useAdventureCreatorLanguage = true
 Set the Dialogue System's localization according to Adventure Creator's current language.
 
bool useAdventureCreatorSubtitlesSetting = false
 Set the Dialogue System's localization according to Adventure Creator's current subtitle settings.
 
bool generateAdventureCreatorLipsyncLines = false
 
bool debug = false
 
bool overrideBridge = false
 
UseDialogState overrideUseDialogState = UseDialogState.IfPlayerInvolved
 
UseDialogState overrideTakeCameraControl = UseDialogState.IfPlayerInvolved
 

Static Public Attributes

static string DialogueSystemGlobalVariableName = "DialogueSystemEnvironment"
 The name of the AC global variable used to store Dialogue System state.
 

Protected Member Functions

virtual void OnDestroy ()
 
IEnumerator SetupSettings ()
 
void UpdateAdventureCreatorItem (string itemName, int itemID, int newCount)
 Updates the count of an item in AC's inventory.
 

Static Protected Member Functions

static GVar GetACVariable (string variableName)
 
static GVar GetACVariableFromList (List< GVar > varList, string variableName)
 
static GVar GetACVariableOnGO (string goName, string variableName)
 

Properties

bool skipSyncToLua [get, set]
 Set this true to skip the next sync to Lua.
 
UseDialogState activeUseDialogState [get]
 
UseDialogState activeTakeCameraControl [get]
 

Detailed Description

This component synchronizes Adventure Creator data with Dialogue System data.

Add it to your Dialogue Manager object. It synchronizes AC's variables with the Dialogue System's Variable[] Lua table, and AC's inventory with the Dialogue System's Item[] Lua table, if the sync checkboxes are ticked. Otherwise you can use the acXXX() Lua functions that this script registers.

It also provides methods to save and load the Dialogue System's state to an AC global variable. You can call these methods when saving and loading games in AC.

Member Function Documentation

◆ acGetBoolean()

static bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acGetBoolean ( string  variableName)
inlinestatic

◆ acGetBooleanOnGO()

static bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acGetBooleanOnGO ( string  goName,
string  variableName 
)
inlinestatic

◆ acGetFloat()

static double PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acGetFloat ( string  variableName)
inlinestatic

◆ acGetFloatOnGO()

static double PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acGetFloatOnGO ( string  goName,
string  variableName 
)
inlinestatic

◆ acGetInteger()

static double PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acGetInteger ( string  variableName)
inlinestatic

◆ acGetIntegerOnGO()

static double PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acGetIntegerOnGO ( string  goName,
string  variableName 
)
inlinestatic

◆ acGetItemCount()

static double PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acGetItemCount ( string  itemName)
inlinestatic

◆ acGetObjectiveState()

static string PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acGetObjectiveState ( double  objID,
string  playerName 
)
inlinestatic

◆ acGetText()

static string PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acGetText ( string  variableName)
inlinestatic

◆ acGetTextOnGO()

static string PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acGetTextOnGO ( string  goName,
string  variableName 
)
inlinestatic

◆ acIncItemCount()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acIncItemCount ( string  itemName,
double  value 
)
inlinestatic

◆ acSetBoolean()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acSetBoolean ( string  variableName,
bool  value 
)
inlinestatic

◆ acSetBooleanOnGO()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acSetBooleanOnGO ( string  goName,
string  variableName,
bool  value 
)
inlinestatic

◆ acSetFloat()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acSetFloat ( string  variableName,
double  value 
)
inlinestatic

◆ acSetFloatOnGO()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acSetFloatOnGO ( string  goName,
string  variableName,
double  value 
)
inlinestatic

◆ acSetInteger()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acSetInteger ( string  variableName,
double  value 
)
inlinestatic

◆ acSetIntegerOnGO()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acSetIntegerOnGO ( string  goName,
string  variableName,
double  value 
)
inlinestatic

◆ acSetItemCount()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acSetItemCount ( string  itemName,
double  value 
)
inlinestatic

◆ acSetText()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acSetText ( string  variableName,
string  value 
)
inlinestatic

◆ acSetTextOnGO()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.acSetTextOnGO ( string  goName,
string  variableName,
string  value 
)
inlinestatic

◆ DisableACCameraControl()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.DisableACCameraControl ( )
inline

◆ EnableACCameraControl()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.EnableACCameraControl ( )
inline

◆ GenerateAdventureCreatorLipsyncLines()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.GenerateAdventureCreatorLipsyncLines ( )
inline

◆ GetACVariable()

static GVar PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.GetACVariable ( string  variableName)
inlinestaticprotected

◆ GetACVariableFromList()

static GVar PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.GetACVariableFromList ( List< GVar >  varList,
string  variableName 
)
inlinestaticprotected

◆ GetACVariableOnGO()

static GVar PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.GetACVariableOnGO ( string  goName,
string  variableName 
)
inlinestaticprotected

◆ IdleACCameraControl()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.IdleACCameraControl ( )
inline

◆ LoadDialogueSystemFromGlobalVariable()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.LoadDialogueSystemFromGlobalVariable ( )
inlinestatic

Loads the Dialogue System state from a dedicated AC global variable.

◆ OnConversationEnd()

virtual void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.OnConversationEnd ( Transform  actor)
inlinevirtual

At the end of a conversation, unfreezes AC and syncs Lua back to AC.

Parameters
actorActor.

◆ OnConversationStart()

virtual void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.OnConversationStart ( Transform  actor)
inlinevirtual

Prepares to run a conversation by freezing AC and syncing data to Lua.

Parameters
actorThe other actor.

◆ OnDestroy()

virtual void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.OnDestroy ( )
inlineprotectedvirtual

◆ RestorePreviousCursor()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.RestorePreviousCursor ( )
inline

Restores the previous cursor.

◆ RestorePreviousGameState()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.RestorePreviousGameState ( )
inline

◆ SaveDialogueSystemToGlobalVariable()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SaveDialogueSystemToGlobalVariable ( )
inlinestatic

Saves the Dialogue System state to a dedicated AC global variable.

This method will create the global variable if it doesn't already exist.

◆ SetConversationCursor()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SetConversationCursor ( )
inline

Sets the conversation cursor.

◆ SetConversationGameState()

virtual void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SetConversationGameState ( )
inlinevirtual

Sets GameState to DialogOptions if specified in the properties.

◆ SetGameStateToCutscene()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SetGameStateToCutscene ( )
inline

Sets AC's GameState to DialogOptions.

◆ SetupSettings()

IEnumerator PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SetupSettings ( )
inlineprotected

◆ Start()

virtual void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.Start ( )
inlinevirtual

◆ SyncAdventureCreatorToLua()

virtual void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SyncAdventureCreatorToLua ( )
inlinevirtual

Syncs the AC data to Lua.

◆ SyncInventoryToLua()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SyncInventoryToLua ( )
inline

Syncs AC's inventory to Lua.

◆ SyncLuaToAdventureCreator()

virtual void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SyncLuaToAdventureCreator ( )
inlinevirtual

Syncs Lua back to AC data.

◆ SyncLuaToInventory()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SyncLuaToInventory ( )
inline

Syncs Lua to AC's inventory.

◆ SyncLuaToVariables()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SyncLuaToVariables ( )
inline

◆ SyncVariablesToLua()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.SyncVariablesToLua ( )
inline

◆ UnsetConversationGameState()

virtual void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.UnsetConversationGameState ( )
inlinevirtual

Restores the previous GameState if necessary.

◆ UpdateAdventureCreatorItem()

void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.UpdateAdventureCreatorItem ( string  itemName,
int  itemID,
int  newCount 
)
inlineprotected

Updates the count of an item in AC's inventory.

Parameters
itemNameItem name.
itemIDItem ID.
newCountNew count.

◆ UpdateSettingsFromAC()

static void PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.UpdateSettingsFromAC ( )
inlinestatic

Member Data Documentation

◆ debug

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.debug = false

◆ DialogueSystemGlobalVariableName

string PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.DialogueSystemGlobalVariableName = "DialogueSystemEnvironment"
static

The name of the AC global variable used to store Dialogue System state.

◆ forceCursorVisibleDuringConversations

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.forceCursorVisibleDuringConversations = true

◆ generateAdventureCreatorLipsyncLines

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.generateAdventureCreatorLipsyncLines = false

◆ includeSimStatus

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.includeSimStatus = false

Set true to include dialogue entry status (offered and/or spoken) in save data.

◆ maxTimeToWaitForCameraStop

float PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.maxTimeToWaitForCameraStop = 10f

The max time to wait for the camera stop if takeCameraControl is AfterStopIfPlayerInvolved.

◆ overrideBridge

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.overrideBridge = false

◆ overrideTakeCameraControl

UseDialogState PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.overrideTakeCameraControl = UseDialogState.IfPlayerInvolved

◆ overrideUseDialogState

UseDialogState PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.overrideUseDialogState = UseDialogState.IfPlayerInvolved

◆ prependGlobalVariables

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.prependGlobalVariables = false

Set true to prepend 'global_' in front of global AC variables in Dialogue System's Variable[] table.

◆ rerunScriptAfterCutscenes

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.rerunScriptAfterCutscenes = false

Set true to resolve race conditions between AC() sequencer command and Lua Script on subsequent dialogue entry.

◆ saveToGlobalVariableOnConversationEnd

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.saveToGlobalVariableOnConversationEnd = false

Set true to save the Lua environment to the AC global variable when conversations end.

◆ syncSettings

SyncSettings PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.syncSettings = new SyncSettings()

◆ takeCameraControl

UseDialogState PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.takeCameraControl = UseDialogState.IfPlayerInvolved

Specifies when conversations should take camera control.

◆ useAdventureCreatorLanguage

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.useAdventureCreatorLanguage = true

Set the Dialogue System's localization according to Adventure Creator's current language.

◆ useAdventureCreatorSubtitlesSetting

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.useAdventureCreatorSubtitlesSetting = false

Set the Dialogue System's localization according to Adventure Creator's current subtitle settings.

◆ useDialogState

UseDialogState PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.useDialogState = UseDialogState.IfPlayerInvolved

The AC GameState to use when in conversations.

Property Documentation

◆ activeTakeCameraControl

UseDialogState PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.activeTakeCameraControl
get

◆ activeUseDialogState

UseDialogState PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.activeUseDialogState
get

◆ skipSyncToLua

bool PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge.skipSyncToLua
getset

Set this true to skip the next sync to Lua.

The Conversation action sets this true because it manually syncs to Lua before the conversation starts.

true to skip sync to lua; otherwise, false.


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