SP8_InventoryComponent
Option | Description |
Starting Items | Set the Items the Player will get, if he is new (For testing). Item: Data Table of Item (Read more). Amount: How much of that Item. Level: Level of the Item. isEquiped: Is the Item equiped? |
Default Max Inventory Size | The Size of the Inventory without any additional Size from SP8_BPI_IncreaseMaxInventorySize |
Since v0.2 QuickSlotKeys | Set for each Element a own Quick Slot Key Name. |
Subtract Level if Enhancement Fails | How many Levels the Item reduces, when the Enhancement fails. Can not go under Level 0! |
Equipment Types | Put here all Equipment Gameplay Tags. |
Item Type Equipment to Actor Comp Type | This Variable connects a Equipment Type with one or more Child Actors, which should be on the Player. Key: Equipment Type Value: All Child Actor Gameplay Tags |
Item Type Consumable | Gameplay Tag of the Item Type Consumable. |
Item Type Equipment | Gameplay Tag of the Item Type Equipment. |
Item Type Costume | Gameplay Tag of the Item Type Costume. |
Since v0.2 EquipmentSets | Contains all Equipment Set’s used in the Game. Key: Equipment Set Name: Name of the Set StatsPerPiece: Key: How many Pieces are giving the Stat Values Value: Set the Stat, which will increase the Stats of the Player |
Inventory Logging | Customize Logs Example: Key: Select LogType Type: Can be left empty if not needed SubType: Can be left empty if not needed (Sometimes it will be overwritten with different Values) Message: What should be printed to the Chat Box. OnlyOnDebug: If true, the Message will be only shown, if the “Inventory Logging Debug” is set to true. |
Inventory Logging Debug | If set to true, every Log of the Inventory Component will be shown in the Chat. |
Function | Callable | Description | Default Use-Case |
TryToAddItemToInventory | Server | Adds a new Item to the Inventory | Example: When Buying an Item. |
TryToRemoveItemFromInventory | Server | Removes an Item from the Inventory | Example: When throwing an Item to the ground. |
TryToRemoveItemFromInventoryByIndex | Server | Removes an Item from the Inventory | Example: When throwing an Item to the ground. |
TryToSellItem | Server & Client | Sell a Item from the Inventory | If a Shop is open and the Player clicks on a Item inside the Inventory Widget. |
TryUseItem | Server & Client | Depending on the Item Type following Function will be called: - Equipment: Equip or Unequip Item - Costume: Equip or Unequip Item - Cosumable: TryToUseConsumable | If the Player clicks on a Item inside the Inventory Widget. |
TryToUseConsumable | Server & Client | Use a consumable Item. Calls SP8_UseConsumable and SP8_Overwrite_UseCustomConsumable. | If the Player clicks on a Item inside the Inventory Widget. |
TryToRemoveConsumableItem | Server | Remove Consumable Item | If you want to remove the Consumable inside SP8_UseConsumable not right away, you can call this Function to remove it. |
TryToSetCustomData | Server | Change the Custom Data of an Item | |
CheckIfInventoryContainsItem | Server & Client | Check if the Inventory contains an Item | When trying to remove an Item. |
getInventoryContent | Server & Client | Get all Items from the Inventory | Get the complete Inventory for displaying it on the Inventory Widget. |
getItemFromInventoryByIndex | Server & Client | Get Item from the Inventory at Index | For displaying to the Player. |
getMaxInventorySize | Server & Client | Get the max Inventory Size | For generating the Slots inside the Inventory Widget. |
getCurrentInventorySize | Server & Client | Get the current Inventory Size | For displaying the current Size to the Player. |
EquipItem | Server & Client | Equip an Item from the Inventory | If the Player clicks on a Item inside the Inventory Widget and the Equipment Widget is open |
UnequipItem | Server & Client | Unequip an Item | If the Player clicks on a Item inside the Equipment Widget. |
setEquipmentActorCompSlots | Server & Client | Set the Actor Component Slots for Equipment Items. | Should be called on Begin Play by the Player BP and before Load. |
getAllEquipedSlots | Server & Client | Get all Equiped Items (Equipment) | For generating the Equipment Window. |
getAllEquipedSlots_Costume | Server & Client | Get all Equiped Items (Costume) | For generating the Costume Window. |
getEquipmentSlotByType | Server & Client | Get Equipment by Equipment Type. | For displaying an equiped Item to the Player. |
getStatByType | Server & Client | Get Stat of Equipment and Costumes. | For adding as additional Value to the Stats Component. |
isItemEnhanceable | Server & Client | Check if Item is enhanceable. | If the Player puts an Item into the Enhancement Window, you can check if he can Enhance it and if yes enable the Enhance Button. |
enhanceItem | Server & Client | Enhance Item. | On click the Enhance Button. |
Since v0.2 getEnhancementChance | Server & Client | Get the Additional Chance for enhancing. | For displaying the correct Chance on the Enhancement Window. |
Since v0.2 TryToUseQuickSlot | Server & Client | Use a Consumable Item, which was added to a Quick Slot. | On Key Press. |
Since v0.2 TryToAddItemToQuickSlot | Server & Client | Try to add an Item to a Quick Slot. | When the Player add’s an Item from the Inventory to the Quick Slot Widget. |
Since v0.2 ClearQuickSlot | Server & Client | Clear a Quick Slot. | When Item was removed from the Quick Slot Widget. |
Since v0.2 GetQuickSlot | Server & Client | Get the Item from the Quick Slot. | For changing the Quick Slot Widget. |
Since v0.2 getEquipedSetCount | Server & Client | Get equiped set count by Set | For displaying the Set Count to the Player. |
Since v0.2 getAllEquipedSetCount | Server & Client | Get equiped set count | For displaying the Set Count to the Player. |
Initialize | Server | If you are using your own Save System, you can use this Function to set the Informations, which this Component needs. | Only if you do not call Load! |
Load | Server | Load all variables | Should be called on start. |
Save | Server | Save all variables |
Dispatcher | Called | Description | Default Use-Case |
InventorySlotChanged | Client | Called if the Inventory has changed. Index -1 will mean, that the Adding failed. If you changed the widget before the Server could execute it, you need to regenerate the Inventory. | Change the Inventory Widget. |
EquipmentChanged | Server & Client | Called if the Equipment has changed. | Change the Equipment Widget |
EnhancementFailed | Client | Called if the Enhancement Failed | Update the Enhancement Widget. Not needed if you are using the PlayerTemplate! |
EnhancementSucceded | Client | Called if the Enhancement Succeded. | Update the Enhancement Widget. Not needed if you are using the PlayerTemplate! |
Since v0.2 QuickSlotChanged | Client | Called, when a Quick Slot is changing. | Update the Quick Slot Slot Widget |
Initialized | Server & Client | Called if all Variables are set and the Component can be used | Initialize all Widgets and stop loading Screen if all Components are initialized. |
SP8_BPI_isItemEnhanceable (Only if you are not using SP8_PlayerTemplate)
Function | Callable | Description | When is it called? |
SP8_isItemEnhanceable | Server & Client | Check if the Player can Enhance an Item. | On isItemEnhanceable. |
Since v0.2 SP8_getAdditionalEnhancementChance | Server & Client | Get the Additional Chance for Enhancement | On isItemEnhanceable. |
SP8_BPI_UseConsumable (Only if you are not using SP8_PlayerTemplate)
Function | Callable | Description | When is it called? |
SP8_useConsumable | Server | Here you can put your logic, when a Consumable Item was beeing used. | Called when a Consumable Item was used. |
SP8_BPI_IncreaseMaxInventorsySize (Only if you are not using SP8_PlayerTemplate)
Function | Callable | Description | When is it called? |
SP8_IncreaseMaxInventorySize | Server & Client | Increase the Max Inventory Size. | On get max Inventory Size. |
Inventory LogTypes
LogType | Description |
Error_OnlyCallableOnServer | Function can only be called on Server. |
Error_ItemDataTableRowNotFound | Data Table of Item does not contain “NewRow”. |
Info_AddItemFailed_InventorySpaceExceeded | Could not add Item to the Inventory, because current inventory Size + new Item would be greater then Max Inventory Size. |
Info_AddItemFailed | Item could not be added to the Inventory. |
Info_AddItemSucceded | Item was added to the Inventory. Overwrite SubType with Item Name and Amount. |
Info_RemoveItemFailed | Item could not be removed from the Inventory. |
Info_RemoveItemSucceded_Removed | Item was removed from the Inventory. |
Info_RemoveItemSucceded_Reduced | Item Amount was reduced. |
Error_ItemNotFoundInInventory | Item could not be found inside the Inventory. |
Error_NotEnoughItemsInInventory | Inventory does not contain enough Items. |
Error_EquipedItemCanNotBeUsed | An equiped Item can not be used. |
Error_NotEnoughAmount | Inventory does not contain enough Items. |
Info_ItemSold | Item was sold. Overwrite SubType with Item Name and Amount |
Error_PriceOfItemNotSet | The Price of the Item is not set. |
Info_ItemNotSellable | Selling Item failed. |
Error_TryUseConsumable_IsNotConsumable | Can only call TryUseConsumable on Consumable Items. |
Info_ConsumableUsed | An Consumable Item was used. Only called if SP8_UseConsumable or SP8_Overwrite_UseConsumable returns true. |
Info_EquipmentDoesNotIncludeLevel | The Level of the Item does not exists inside Stats. |
Error_ItemNotEquipable | Item can not be equiped. |
Info_EquipeFailed_LevelNotHighEnough | The Level of the Player is lower then the needed Level. Overwrite SubType with needed Level |
Info_ItemEquiped | Item was equiped. Overwrite SubType with Inventory Index |
Error_NoItemEquiped | There is no Item equiped at the Slot. |
Info_ItemUnequiped | Item was unequiped. Overwrite SubType with Inventory Index |
Error_ItemEnhancementDoesNotIncludeLevel | The Level of the Item does not exists inside Enhancement. |
Info_EnhancementFailed_NotEnoughUppItems | Enhancement failed, because the Inventory does not contain enough Items. Overwrite SubType with Inventory Index |
Info_EnhancementWorked | Enhancement succeded. Overwrite SubType with Inventory Index |
Info_EnhancementFailed_NotEnoughCurrency | Interface Function hasEnoughCurrency returned false. If using the PlayerTemplate: Sp8_Override_hasEnoughCurrency. |
Error_EnhancementFailed_NotEnhanceable | Item is not enhanceable. |
Info_EnhancementFailed | Everything worked, but the Enhancement failed. |
Info_Initialized | Called on Initialize. |
Info_UseConsumableFailed_LevelNotHighEnough | Could not use consumable, because the Level of the Player is not high enough. |
Since v0.2 Info_QuickSlotIsEmpty | Called on TryToUseQuickSlot, if the Quick Slot does not contain an Item. |
Since v0.2 Info_QuickSlotDoesNotExists | Called on TryToAddItemToQuickSlot, if the Quick Slot does not exists. |
Since v0.2 Error_OnlyConsumablesCanBeAddedToQuickSlot | Called on TryToAddItemToQuickSlot, if the Item is not a Consumable Item. |