PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge Class Reference

This Dialogue System / Third Person Controller bridge component integrates a TPC character with the Dialogue System. More...

Inheritance diagram for PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge:
Collaboration diagram for PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge:

Public Member Functions

virtual void Start ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void OnConversationStart (Transform actor)
 When a conversation starts, if deactivateDuringConversations is true, disables TPC control. More...
 
virtual void OnConversationEnd (Transform actor)
 When a conversation ends, if deactivateDuringConversations is true, re-enables TPC control. More...
 
virtual void EnableTpcControl ()
 Enables TPC control. More...
 
virtual void DisableTpcControl ()
 Disables TPC control. More...
 
virtual void SetTpcControl (bool value)
 Sets TPC control on or off. More...
 
virtual void SetTpcControl (bool enableCharacter, bool enableCamera, bool enableInput)
 Sets TPC control on or off. More...
 
virtual void Holster ()
 
virtual void Unholster ()
 
virtual void OnRecordPersistentData ()
 Saves the TPC's current position & inventory to Lua. More...
 
virtual void OnApplyPersistentData ()
 Retrieves position & inventory from Lua and applies it to the TPC. More...
 
void SavePosition ()
 
void LoadPosition ()
 
virtual void SaveInventory ()
 
virtual void LoadInventory ()
 
virtual void SaveStats ()
 
virtual void LoadStats ()
 

Static Public Member Functions

static void RegisterLuaFunctions ()
 Registers the TPC Lua functions with the Dialogue System. More...
 
static double tpcGetHealth (string characterName)
 
static double tpcGetShield (string characterName)
 
static void tpcSetInvincible (string characterName, bool value)
 
static void tpcHeal (string characterName, double amount)
 
static void tpcDamage (string characterName, double amount)
 
static void tpcSetMaxHealth (string characterName, double amount)
 
static void tpcSetMaxShield (string characterName, double amount)
 
static void tpcSetShieldRegenerativeAmount (string characterName, double amount)
 
static bool tpcHasCurrentItem (string characterName, string itemName, bool primaryItem)
 
static double tpcGetItemCount (string characterName, string itemName, bool loadedCount)
 
static void tpcPickupItem (string characterName, string itemName, double amount, bool equip, bool immediateActivation)
 
static void tpcRemoveItem (string characterName, string itemName, bool immediateRemoval)
 
static void tpcRemoveAllItems (string characterName)
 
static GameObject FindCharacter (string characterName)
 Finds a character by its GameObject name. More...
 
static T GetCharacterComponent< T > (string characterName)
 Gets a component on a GameObject with the specified name. More...
 

Public Attributes

string overrideActorName
 (Optional) Normally, this component uses the game object's name, or "Player" for the player, to match up with the name of the actor in your dialogue database. More...
 
bool deactivateDuringConversations = true
 Set true to deactivate TPC controls during conversations. More...
 
bool holsterDuringConversations = false
 Switch to unequipped weapon type during conversations. More...
 
GameObject[] additionalObjectsToDeactivate = new GameObject[0]
 
bool recordStats = true
 Set true to record stats (health, etc.) in save data. More...
 
bool recordInventory = true
 Set true to record inventory in save data. More...
 
bool recordPosition = true
 Set true to record position in save data. More...
 
bool recordCurrentLevel = true
 Set `true to record the character's current level. More...
 
int framesToWaitBeforeApplyingPersistentData = 0
 When applying persistent data such as loading a saved game, wait this many frames for other scripts to finish their initialization. More...
 
bool debug = false
 
Opsive.ThirdPersonController.ItemType unequippedItemType
 The unequipped item type. More...
 
Opsive.ThirdPersonController.ItemType[] itemTypes = new Opsive.ThirdPersonController.ItemType[0]
 The item types that are available to Lua functions. More...
 

Protected Member Functions

virtual void FindComponents ()
 
IEnumerator ApplyPersistentDataDelayed ()
 
virtual void ApplyPersistentDataNow ()
 
virtual string GetSanitizedLevelName ()
 
string GetPositionString ()
 
void ApplyPositionString (string s)
 

Static Protected Member Functions

static Opsive.ThirdPersonController.ItemType GetItemType (string itemName)
 
static Opsive.ThirdPersonController.ItemType GetItemType (int itemID)
 

Protected Attributes

Opsive.ThirdPersonController.RigidbodyCharacterController m_rbcc = null
 
Opsive.ThirdPersonController.Inventory m_inventory = null
 
Opsive.ThirdPersonController.ControllerHandler m_controllerHandler = null
 
Opsive.ThirdPersonController.CameraController m_cameraController = null
 
Opsive.ThirdPersonController.UI.AbilityIndicatorMonitor m_abilityIndicatorMonitor = null
 
bool m_wasInventoryEnabled
 
bool m_wasControllerHandlerEnabled
 

Static Protected Attributes

static Opsive.ThirdPersonController.ItemType[] s_globalItemTypes = null
 

Properties

bool showDebug [get]
 
bool isPlayer [get]
 

Detailed Description

This Dialogue System / Third Person Controller bridge component integrates a TPC character with the Dialogue System.

Member Function Documentation

◆ ApplyPersistentDataDelayed()

IEnumerator PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.ApplyPersistentDataDelayed ( )
protected

◆ ApplyPersistentDataNow()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.ApplyPersistentDataNow ( )
protectedvirtual

◆ ApplyPositionString()

void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.ApplyPositionString ( string  s)
protected

◆ DisableTpcControl()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.DisableTpcControl ( )
virtual

Disables TPC control.

◆ EnableTpcControl()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.EnableTpcControl ( )
virtual

Enables TPC control.

◆ FindCharacter()

static GameObject PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.FindCharacter ( string  characterName)
static

Finds a character by its GameObject name.

Returns
The character GameObject.
Parameters
characterNameName of the GameObject.

◆ FindComponents()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.FindComponents ( )
protectedvirtual

◆ GetCharacterComponent< T >()

static T PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.GetCharacterComponent< T > ( string  characterName)
static

Gets a component on a GameObject with the specified name.

Returns
The component, or null if not found.
Parameters
characterNameName of the GameObject.
Type Constraints
T :Component 

◆ GetItemType() [1/2]

static Opsive.ThirdPersonController.ItemType PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.GetItemType ( int  itemID)
staticprotected

◆ GetItemType() [2/2]

static Opsive.ThirdPersonController.ItemType PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.GetItemType ( string  itemName)
staticprotected

◆ GetPositionString()

string PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.GetPositionString ( )
protected

◆ GetSanitizedLevelName()

virtual string PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.GetSanitizedLevelName ( )
protectedvirtual

◆ Holster()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.Holster ( )
virtual

◆ LoadInventory()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.LoadInventory ( )
virtual

◆ LoadPosition()

void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.LoadPosition ( )

◆ LoadStats()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.LoadStats ( )
virtual

◆ OnApplyPersistentData()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.OnApplyPersistentData ( )
virtual

Retrieves position & inventory from Lua and applies it to the TPC.

◆ OnConversationEnd()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.OnConversationEnd ( Transform  actor)
virtual

When a conversation ends, if deactivateDuringConversations is true, re-enables TPC control.

Parameters
actorActor.

◆ OnConversationStart()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.OnConversationStart ( Transform  actor)
virtual

When a conversation starts, if deactivateDuringConversations is true, disables TPC control.

Parameters
actorActor.

◆ OnDisable()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.OnDisable ( )
virtual

◆ OnEnable()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.OnEnable ( )
virtual

◆ OnRecordPersistentData()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.OnRecordPersistentData ( )
virtual

Saves the TPC's current position & inventory to Lua.

◆ RegisterLuaFunctions()

static void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.RegisterLuaFunctions ( )
static

Registers the TPC Lua functions with the Dialogue System.

◆ SaveInventory()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.SaveInventory ( )
virtual

◆ SavePosition()

void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.SavePosition ( )

◆ SaveStats()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.SaveStats ( )
virtual

◆ SetTpcControl() [1/2]

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.SetTpcControl ( bool  enableCharacter,
bool  enableCamera,
bool  enableInput 
)
virtual

Sets TPC control on or off.

Parameters
valueIf set to true, let TPC control the character.
enableCameraIf set to true, enable the camera
enableInputIf set to true, enable player input

◆ SetTpcControl() [2/2]

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.SetTpcControl ( bool  value)
virtual

Sets TPC control on or off.

Parameters
valueIf set to true, let TPC control the character.

◆ Start()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.Start ( )
virtual

◆ tpcDamage()

static void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcDamage ( string  characterName,
double  amount 
)
static

◆ tpcGetHealth()

static double PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcGetHealth ( string  characterName)
static

◆ tpcGetItemCount()

static double PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcGetItemCount ( string  characterName,
string  itemName,
bool  loadedCount 
)
static

◆ tpcGetShield()

static double PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcGetShield ( string  characterName)
static

◆ tpcHasCurrentItem()

static bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcHasCurrentItem ( string  characterName,
string  itemName,
bool  primaryItem 
)
static

◆ tpcHeal()

static void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcHeal ( string  characterName,
double  amount 
)
static

◆ tpcPickupItem()

static void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcPickupItem ( string  characterName,
string  itemName,
double  amount,
bool  equip,
bool  immediateActivation 
)
static

◆ tpcRemoveAllItems()

static void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcRemoveAllItems ( string  characterName)
static

◆ tpcRemoveItem()

static void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcRemoveItem ( string  characterName,
string  itemName,
bool  immediateRemoval 
)
static

◆ tpcSetInvincible()

static void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcSetInvincible ( string  characterName,
bool  value 
)
static

◆ tpcSetMaxHealth()

static void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcSetMaxHealth ( string  characterName,
double  amount 
)
static

◆ tpcSetMaxShield()

static void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcSetMaxShield ( string  characterName,
double  amount 
)
static

◆ tpcSetShieldRegenerativeAmount()

static void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.tpcSetShieldRegenerativeAmount ( string  characterName,
double  amount 
)
static

◆ Unholster()

virtual void PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.Unholster ( )
virtual

Member Data Documentation

◆ additionalObjectsToDeactivate

GameObject [] PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.additionalObjectsToDeactivate = new GameObject[0]

◆ deactivateDuringConversations

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.deactivateDuringConversations = true

Set true to deactivate TPC controls during conversations.

◆ debug

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.debug = false

◆ framesToWaitBeforeApplyingPersistentData

int PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.framesToWaitBeforeApplyingPersistentData = 0

When applying persistent data such as loading a saved game, wait this many frames for other scripts to finish their initialization.

◆ holsterDuringConversations

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.holsterDuringConversations = false

Switch to unequipped weapon type during conversations.

◆ itemTypes

Opsive.ThirdPersonController.ItemType [] PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.itemTypes = new Opsive.ThirdPersonController.ItemType[0]

The item types that are available to Lua functions.

You only need to specify an item types list on one character, usually the player.

◆ m_abilityIndicatorMonitor

Opsive.ThirdPersonController.UI.AbilityIndicatorMonitor PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.m_abilityIndicatorMonitor = null
protected

◆ m_cameraController

Opsive.ThirdPersonController.CameraController PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.m_cameraController = null
protected

◆ m_controllerHandler

Opsive.ThirdPersonController.ControllerHandler PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.m_controllerHandler = null
protected

◆ m_inventory

Opsive.ThirdPersonController.Inventory PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.m_inventory = null
protected

◆ m_rbcc

Opsive.ThirdPersonController.RigidbodyCharacterController PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.m_rbcc = null
protected

◆ m_wasControllerHandlerEnabled

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.m_wasControllerHandlerEnabled
protected

◆ m_wasInventoryEnabled

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.m_wasInventoryEnabled
protected

◆ overrideActorName

string PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.overrideActorName

(Optional) Normally, this component uses the game object's name, or "Player" for the player, to match up with the name of the actor in your dialogue database.

If your actor is named differently in your dialogue database, set this property to the actor's name.

◆ recordCurrentLevel

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.recordCurrentLevel = true

Set `true to record the character's current level.

If so, then on load the position is only applied if the current level matches the recorded level.

◆ recordInventory

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.recordInventory = true

Set true to record inventory in save data.

◆ recordPosition

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.recordPosition = true

Set true to record position in save data.

◆ recordStats

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.recordStats = true

Set true to record stats (health, etc.) in save data.

◆ s_globalItemTypes

Opsive.ThirdPersonController.ItemType [] PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.s_globalItemTypes = null
staticprotected

◆ unequippedItemType

Opsive.ThirdPersonController.ItemType PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.unequippedItemType

The unequipped item type.

The TPC Inventory script doesn't expose its item type, so we need to redeclare it here.

Property Documentation

◆ isPlayer

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.isPlayer
get

◆ showDebug

bool PixelCrushers.DialogueSystem.ThirdPersonControllerSupport.DialogueSystemThirdPersonControllerBridge.showDebug
get

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