This is a utility component to help synchronize the Dialogue System's Lua environment with the UFPS player. More...
Public Member Functions | |
virtual void | Awake () |
virtual void | Start () |
void | OnConversationStart (Transform actor) |
void | OnConversationEnd (Transform actor) |
virtual void | DeactivateCurrentWeapon () |
Deactivates the current weapon. | |
virtual void | ActivateCurrentWeapon () |
Activates the current weapon. | |
virtual void | SyncFPToLua () |
Records the UFPS player's data into the Dialogue System's Lua environment. | |
virtual void | SyncLuaToFP () |
Updates the UFPS player's data with the current values in the Dialogue System's Lua environment. | |
void | SyncFPStatsToLua () |
Syncs UFPS's player stats to Lua. | |
void | SyncLuaToFPStats () |
Syncs Lua to UFPS's player stats. | |
void | SyncFPInventoryToLua () |
Syncs the UFPS inventory to Lua. | |
void | SyncLuaToFPInventory () |
Syncs Lua to the UFPS inventory. | |
void | SyncFPWeaponHandlerToLua () |
Syncs the player's current weapon index to Lua. | |
void | SyncLuaToFPWeaponHandler () |
Syncs the current weapon index stored in Lua to be the player's current weapon. | |
void | SetPlayerField (string fieldName, object value) |
Sets a player field in the Actor table. | |
Lua.Result | GetPlayerField (string fieldName) |
Gets a player field in the Actor table. | |
Public Attributes | |
bool | syncUFPSDuringConversations = true |
Sync UFPS data to Dialogue System at start of conversation, back to UFPS at end. | |
bool | disableWeaponDuringConversations = true |
Set true to disable the player's weapon during conversations. | |
List< vp_ItemType > | usableItemTypes = new List<vp_ItemType>() |
The usable item types. | |
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. | |
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. | |
string | LuaPlayerIndex [get] |
Gets the string index of the player in the Actor[] table. | |
This is a utility component to help synchronize the Dialogue System's Lua environment with the UFPS player.
It synchronizes health and inventory.
Every weapon (e.g., "Pistol") has an associated Lua variable (e.g., Variable["Pistol"]
) that is equal to the count or ammo count (if it uses ammo) if the player has the weapon or 0
if the player doesn't. During conversations, your dialogue entries can check and/or set the values using Lua conditions and scripts.
|
inlinevirtual |
Activates the current weapon.
Used when ending a conversation.
|
inlinevirtual |
|
inlineprotectedvirtual |
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.
false
.
|
inlinevirtual |
Deactivates the current weapon.
Used when starting a conversation.
|
inline |
Gets a player field in the Actor table.
fieldName | Field name. |
|
inline |
|
inline |
|
inline |
Sets a player field in the Actor table.
fieldName | Field name. |
value | Value. |
|
inlinevirtual |
|
inline |
Syncs the UFPS inventory to Lua.
|
inline |
Syncs UFPS's player stats to Lua.
|
inlinevirtual |
Records the UFPS player's data into the Dialogue System's Lua environment.
Records the player's health and inventory (weapons and items).
|
inline |
Syncs the player's current weapon index to Lua.
|
inlinevirtual |
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.
|
inline |
Syncs Lua to the UFPS inventory.
|
inline |
Syncs Lua to UFPS's player stats.
|
inline |
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.)
bool PixelCrushers.DialogueSystem.UFPSSupport.FPPlayerLuaBridge.debug = false |
bool PixelCrushers.DialogueSystem.UFPSSupport.FPPlayerLuaBridge.disableWeaponDuringConversations = true |
Set true
to disable the player's weapon during conversations.
bool PixelCrushers.DialogueSystem.UFPSSupport.FPPlayerLuaBridge.syncUFPSDuringConversations = true |
Sync UFPS data to Dialogue System at start of conversation, back to UFPS at end.
List<vp_ItemType> PixelCrushers.DialogueSystem.UFPSSupport.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.
|
getset |
|
get |
|
get |
|
get |
|
get |
Gets the string index of the player in the Actor[]
table.
The string index for Lua.
|
get |
Gets the name of the player in the dialogue database.
The name of the player in the dialogue database.