PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge Class Reference

This component synchronizes data between the Realistic FPS Prefab player and the Dialogue System's Lua environment. More...

Inheritance diagram for PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge:
Collaboration diagram for PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge:

Public Member Functions

void Start ()
 
void OnConversationStart (Transform actor)
 
void OnConversationEnd (Transform actor)
 When a conversation ends, sync Lua to FPS. More...
 
void OnRecordPersistentData ()
 When the bridge receives the OnRecordPersistentData message, it saves the player's Realistic FPS Prefab data to the Dialogue System's Lua environment. More...
 
void OnApplyPersistentData ()
 When the bridge receives the OnApplyPersistentData message, it applies the saved data from the Dialogue System's Lua environment to the player. More...
 
void SyncFPSToLua ()
 Records the FPS player data into the Dialogue System's Lua environment. More...
 
void SyncLuaToFPS ()
 Updates the FPS player data with the current values in the Dialogue System's Lua environment. More...
 
void HideHUD ()
 Hides the HUD. More...
 
void ShowHUD ()
 Shows the HUD. More...
 
void SavePosition ()
 
void LoadPosition ()
 
void Start ()
 
void OnConversationStart (Transform actor)
 
void OnConversationEnd (Transform actor)
 When a conversation ends, sync Lua to FPS. More...
 
void OnRecordPersistentData ()
 When the bridge receives the OnRecordPersistentData message, it saves the player's Realistic FPS Prefab data to the Dialogue System's Lua environment. More...
 
void OnApplyPersistentData ()
 When the bridge receives the OnApplyPersistentData message, it applies the saved data from the Dialogue System's Lua environment to the player. More...
 
void SyncFPSToLua ()
 Records the FPS player data into the Dialogue System's Lua environment. More...
 
void SyncLuaToFPS ()
 Updates the FPS player data with the current values in the Dialogue System's Lua environment. More...
 
void HideHUD ()
 Hides the HUD. More...
 
void ShowHUD ()
 Shows the HUD. More...
 
void SavePosition ()
 
void LoadPosition ()
 

Public Attributes

string playerActorName = "Player"
 
bool hideHudInConversations = true
 
bool savePosition = true
 
bool debug = false
 
bool recordCurrentLevel = true
 

Protected Member Functions

virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 

Detailed Description

This component synchronizes data between the Realistic FPS Prefab player and the Dialogue System's Lua environment.

It automatically synchronizes before and after conversations, and you can synchronize manually using SyncFPSToLua() and SyncLuaToFPS().

It uses the following values in the Lua environment:

  • Actor["Player"].hitPoints: Current hit points.
  • Actor["Player"].maximumHitPoints: Maximum hit points.
  • Actor["Player"].hungerPoints: Current hunger points.
  • Actor["Player"].thirstPoints: Current thirst points.
    • Note: Player Actor Name defaults to "Player", but you can change it if the name of your player actor is different in your dialogue database.
  • Variable["<weapon-name>"] (for each weapon): A Boolean (true or false) indicating whether the player has the named weapon.
    • Example: Variable["Shotgun"] == true is true when the player has the shotgun.
    • Example: Variable["Shotgun"] = false takes the shotgun away from the player.
  • If the player name or any weapon names have spaces, those spaces will be replaced with underscores (_) in Lua.

Member Function Documentation

◆ HideHUD() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.HideHUD ( )

Hides the HUD.

◆ HideHUD() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.HideHUD ( )

Hides the HUD.

◆ LoadPosition() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.LoadPosition ( )

◆ LoadPosition() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.LoadPosition ( )

◆ OnApplyPersistentData() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnApplyPersistentData ( )

When the bridge receives the OnApplyPersistentData message, it applies the saved data from the Dialogue System's Lua environment to the player.

Also temporarily disables fall damage; otherwise if we apply a recorded persistent position that's lower than the starting position, the FPSRigidbodyWalker will think we're falling and apply fall damage.

◆ OnApplyPersistentData() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnApplyPersistentData ( )

When the bridge receives the OnApplyPersistentData message, it applies the saved data from the Dialogue System's Lua environment to the player.

Also temporarily disables fall damage; otherwise if we apply a recorded persistent position that's lower than the starting position, the FPSRigidbodyWalker will think we're falling and apply fall damage.

◆ OnConversationEnd() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnConversationEnd ( Transform  actor)

When a conversation ends, sync Lua to FPS.

Parameters
actorActor participating in the conversation.

◆ OnConversationEnd() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnConversationEnd ( Transform  actor)

When a conversation ends, sync Lua to FPS.

Parameters
actorActor participating in the conversation.

◆ OnConversationStart() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnConversationStart ( Transform  actor)

When a conversation starts, sync FPS to Lua.

Parameters
actorActor participating in the conversation.

◆ OnConversationStart() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnConversationStart ( Transform  actor)

When a conversation starts, sync FPS to Lua.

Parameters
actorActor participating in the conversation.

◆ OnDisable() [1/2]

virtual void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnDisable ( )
protectedvirtual

◆ OnDisable() [2/2]

virtual void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnDisable ( )
protectedvirtual

◆ OnEnable() [1/2]

virtual void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnEnable ( )
protectedvirtual

◆ OnEnable() [2/2]

virtual void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnEnable ( )
protectedvirtual

◆ OnRecordPersistentData() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnRecordPersistentData ( )

When the bridge receives the OnRecordPersistentData message, it saves the player's Realistic FPS Prefab data to the Dialogue System's Lua environment.

◆ OnRecordPersistentData() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.OnRecordPersistentData ( )

When the bridge receives the OnRecordPersistentData message, it saves the player's Realistic FPS Prefab data to the Dialogue System's Lua environment.

◆ SavePosition() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.SavePosition ( )

◆ SavePosition() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.SavePosition ( )

◆ ShowHUD() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.ShowHUD ( )

Shows the HUD.

◆ ShowHUD() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.ShowHUD ( )

Shows the HUD.

◆ Start() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.Start ( )

◆ Start() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.Start ( )

◆ SyncFPSToLua() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.SyncFPSToLua ( )

Records the FPS player data into the Dialogue System's Lua environment.

◆ SyncFPSToLua() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.SyncFPSToLua ( )

Records the FPS player data into the Dialogue System's Lua environment.

◆ SyncLuaToFPS() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.SyncLuaToFPS ( )

Updates the FPS player data with the current values in the Dialogue System's Lua environment.

◆ SyncLuaToFPS() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.SyncLuaToFPS ( )

Updates the FPS player data with the current values in the Dialogue System's Lua environment.

Member Data Documentation

◆ debug

bool PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.debug = false

◆ hideHudInConversations

bool PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.hideHudInConversations = true

◆ playerActorName

string PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.playerActorName = "Player"

◆ recordCurrentLevel

bool PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.recordCurrentLevel = true

◆ savePosition

bool PixelCrushers.DialogueSystem.RealisticFPSPrefab.FPSLuaBridge.savePosition = true

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