UInventoryBase
(UObject)
(UObject)
The Inventory class tracks and organizes InventoryItems. They have save and load built-in and are responsible for remaking the items in their contents when loading from save. Inventories can either be used directly by instantiating and managing your own with the help of the InventoryManagerSubsystem or by adding an InventoryComponent to any actor.
Add ItemTags to this array to limit what InventoryItems can be added to an Inventory.
These items will be added automatically to the Inventory if no save data is found on load. These values can be overwritten when calling InitializeInventory().
Sets the default number of slots for the Inventory. This value can be overwritten when calling InitializeInventory().
Sets a unique identifier used for saving and loading. This value can be overwritten when calling InitializeInventory().
Initialize the Inventory and overwrite the default values of the derived class.
NOTE: If this function is not called, the default values set on the derived class will be used.
Compares the input InventoryItem tags to the Inventory's tags and returns if a match was found.
Adds an InventoryItem to the Inventory. This function returns three different scenarios:
Rejected = The item was not added to an item slot for various reasons and returns the item back to you.
NoRemainder = The entire item amount was added to the slot and the item returned does not need to be handled (but you may need to finish removing the item from another inventory if this was a transfer).
Leftovers = Returns the item with decreased amount because an item slot could not take all of the amount or returns the item that use to be in the slot swapped out for the item you added if the item classes did not .
Decreases the stack count of an InventoryItem in a specific slot and returns how many items in that stack remain. Does not automatically remove the item when zero remain.
Decreases the first found stack count of an InventoryItem that matches the input and returns how many items in that stack remain. Does not automatically remove the item when zero remain.
Removes an InventoryItem from the specific slot in the Inventory regardless of stack count.
Removes the first InventoryItem that matches the input regardless of stack count.
Gets the item at the input index. Fires the false output pin if no item is at the index.
Call this function to manually save data any time. Do not override unless you've checked the C++ implementation first (being able to override is a side effect of the current C++ to Blueprint implementation). This function calls the SaveData function automatically unless overriden.
Call this function to manually load data at any time. Do not override unless you've checked the C++ implementation first (being able to override is a side effect of the current C++ to Blueprint implementation). This function calls the LoadData function automatically unless overriden.
Override this function to implement saving data unique to a derived Inventory class. Always make sure to call the parent function and pass the save game object up the inheritance tree when overriding.
Override this function to implement loading data unique to a derived Inventory class. Always make sure to call the parent function and pass the save game object up the inheritance tree when overriding.
Gets the currently loaded KSaveGame object.