PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge Class Reference

This is a utility component to help synchronize the Dialogue System's Lua environment with the UFPS player. More...

Inheritance diagram for PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge:
Collaboration diagram for PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge:

Public Member Functions

virtual void Awake ()
 
virtual void Start ()
 
virtual void DeactivateCurrentWeapon ()
 Deactivates the current weapon. More...
 
virtual void ActivateCurrentWeapon ()
 Activates the current weapon. More...
 
virtual void SyncFPToLua ()
 Records the UFPS player's data into the Dialogue System's Lua environment. More...
 
virtual void SyncLuaToFP ()
 Updates the UFPS player's data with the current values in the Dialogue System's Lua environment. More...
 
void SyncFPStatsToLua ()
 Syncs UFPS's player stats to Lua. More...
 
void SyncLuaToFPStats ()
 Syncs Lua to UFPS's player stats. More...
 
void SyncFPInventoryToLua ()
 Syncs the UFPS inventory to Lua. More...
 
void SyncLuaToFPInventory ()
 Syncs Lua to the UFPS inventory. More...
 
void SyncFPWeaponHandlerToLua ()
 Syncs the player's current weapon index to Lua. More...
 
void SyncLuaToFPWeaponHandler ()
 Syncs the current weapon index stored in Lua to be the player's current weapon. More...
 
void SetPlayerField (string fieldName, object value)
 Sets a player field in the Actor table. More...
 
Lua.Result GetPlayerField (string fieldName)
 Gets a player field in the Actor table. More...
 

Public Attributes

List< vp_ItemType > usableItemTypes = new List<vp_ItemType>()
 The usable item types. More...
 
bool debug = false
 

Protected Member Functions

virtual bool CanStart_SetWeapon ()
 The bridge temporarily registers this method with UFPS when applying the Lua inventory data back into UFPS. More...
 

Properties

vp_FPPlayerEventHandler fpPlayer [get]
 
vp_Inventory fpInventory [get]
 
vp_FPWeaponHandler fpWeaponHandler [get]
 
bool forceWield [get, set]
 
string LuaPlayerName [get]
 Gets the name of the player in the dialogue database More...
 
string LuaPlayerIndex [get]
 Gets the string index of the player in the Actor[] table More...
 

Detailed Description

This is a utility component to help synchronize the Dialogue System's Lua environment with the UFPS player.

It synchronizes health and inventory.

Member Function Documentation

◆ ActivateCurrentWeapon()

virtual void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.ActivateCurrentWeapon ( )
virtual

Activates the current weapon.

Used when ending a conversation.

◆ Awake()

virtual void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.Awake ( )
virtual

◆ CanStart_SetWeapon()

virtual bool PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.CanStart_SetWeapon ( )
protectedvirtual

The bridge temporarily registers this method with UFPS when applying the Lua inventory data back into UFPS.

It prevents UFPS from playing equip/load animations.

Returns
false.

◆ DeactivateCurrentWeapon()

virtual void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.DeactivateCurrentWeapon ( )
virtual

Deactivates the current weapon.

Used when starting a conversation.

◆ GetPlayerField()

Lua.Result PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.GetPlayerField ( string  fieldName)

Gets a player field in the Actor table.

Returns
The player field.
Parameters
fieldNameField name.

◆ SetPlayerField()

void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.SetPlayerField ( string  fieldName,
object  value 
)

Sets a player field in the Actor table.

Parameters
fieldNameField name.
valueValue.

◆ Start()

virtual void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.Start ( )
virtual

◆ SyncFPInventoryToLua()

void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.SyncFPInventoryToLua ( )

Syncs the UFPS inventory to Lua.

◆ SyncFPStatsToLua()

void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.SyncFPStatsToLua ( )

Syncs UFPS's player stats to Lua.

◆ SyncFPToLua()

virtual void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.SyncFPToLua ( )
virtual

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

Records the player's health and inventory (weapons and items).

◆ SyncFPWeaponHandlerToLua()

void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.SyncFPWeaponHandlerToLua ( )

Syncs the player's current weapon index to Lua.

◆ SyncLuaToFP()

virtual void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.SyncLuaToFP ( )
virtual

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

Updates the player's health and inventory (weapons and items). Also uses fpPlayer.Register() to hook into CanStart_Weapon() to prevent UFPS from playing equip/load animations if the inventory has changed.

◆ SyncLuaToFPInventory()

void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.SyncLuaToFPInventory ( )

Syncs Lua to the UFPS inventory.

◆ SyncLuaToFPStats()

void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.SyncLuaToFPStats ( )

Syncs Lua to UFPS's player stats.

◆ SyncLuaToFPWeaponHandler()

void PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.SyncLuaToFPWeaponHandler ( )

Syncs the current weapon index stored in Lua to be the player's current weapon.

Since the bridge has temporarily disabled equip/load animations, we can set the weapon immediately. (In an earlier version of this script that lacked the code to disable equip/load animations, we invoked SetWeapon() after 0.5s.)

Member Data Documentation

◆ debug

bool PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.debug = false

◆ usableItemTypes

List<vp_ItemType> PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.usableItemTypes = new List<vp_ItemType>()

The usable item types.

Assign all item types that the player can possibly use here. These item types will be synchronized with Lua.

Property Documentation

◆ forceWield

bool PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.forceWield
getset

◆ fpInventory

vp_Inventory PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.fpInventory
get

◆ fpPlayer

vp_FPPlayerEventHandler PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.fpPlayer
get

◆ fpWeaponHandler

vp_FPWeaponHandler PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.fpWeaponHandler
get

◆ LuaPlayerIndex

string PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.LuaPlayerIndex
get

Gets the string index of the player in the Actor[] table

The string index for Lua.

◆ LuaPlayerName

string PixelCrushers.DialogueSystem.UFPS.FPPlayerLuaBridge.LuaPlayerName
get

Gets the name of the player in the dialogue database

The name of the player in the dialogue database.


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