FrameworkZ API - FrameworkZ.Inventories

FrameworkZ.Inventories

module

The Inventories module for FrameworkZ. Defines and interacts with INVENTORY object.

0
Functions
22
Methods
4
Fields

Fields

4
FrameworkZ.Inventories 📋 table
The Inventories module for FrameworkZ. Defines and interacts with INVENTORY object.
Initial value: {}
FrameworkZ.Inventories.SlotLookup ❓ unknown inferred
Initial value: slotLookup
FrameworkZ.Inventories.SlotNameLookup ❓ unknown inferred
Initial value: reverse
FrameworkZ.Inventories.Types 📋 table inferred
Initial value: { Character = "Character", Container = "Container", Vehicle = "Vehicle" }

Methods

22

FrameworkZ.Inventories:ApplyEquipmentColor(item, itemData)

method
Apply equipment color AFTER equipping to prevent randomization override

Parameters

item 🏷️ InventoryItem
The equipped item
itemData 📋 table
The item data containing color information

Returns

✅ boolean
True if color was applied

FrameworkZ.Inventories:ExtractBasicProperties(item, itemData)

method
Extract basic item properties (condition, weight, uses)

Parameters

item 🏷️ InventoryItem
The item to extract from
itemData 📋 table
The data table to populate

FrameworkZ.Inventories:ExtractClothingProperties(item, itemData)

method
Extract clothing-specific properties (dirty, wet, bloody, holes, patches)

Parameters

item 🏷️ InventoryItem
The item to extract from
itemData 📋 table
The data table to populate

FrameworkZ.Inventories:ExtractColorData(item, itemData)

method
Extract color/tint information (prefers visual tint for clothing)

Parameters

item 🏷️ InventoryItem
The item to extract from
itemData 📋 table
The data table to populate

FrameworkZ.Inventories:ExtractContainerProperties(item, itemData)

method
Extract container-specific properties (capacity, contents with recursive extraction)

Parameters

item 🏷️ InventoryItem
The item to extract from
itemData 📋 table
The data table to populate

FrameworkZ.Inventories:ExtractFoodProperties(item, itemData)

method
Extract food-specific properties (freshness, age, frozen state)

Parameters

item 🏷️ InventoryItem
The item to extract from
itemData 📋 table
The data table to populate

FrameworkZ.Inventories:ExtractItemData(item)

method
Extract comprehensive item data by calling all category-specific extractors

Parameters

item 🏷️ InventoryItem
The item to extract data from

Returns

📋 table
Comprehensive item data

FrameworkZ.Inventories:ExtractLiteratureProperties(item, itemData)

method
Extract literature-specific properties (pages, locks, writing)

Parameters

item 🏷️ InventoryItem
The item to extract from
itemData 📋 table
The data table to populate

FrameworkZ.Inventories:ExtractModData(item, itemData)

method
Extract ModData from an item

Parameters

item 🏷️ InventoryItem
The item to extract from
itemData 📋 table
The data table to populate

FrameworkZ.Inventories:ExtractWeaponProperties(item, itemData)

method
Extract weapon-specific properties (ammo, magazine, bullets)

Parameters

item 🏷️ InventoryItem
The item to extract from
itemData 📋 table
The data table to populate

FrameworkZ.Inventories:GetInventoryByID(id)

method
Get an inventory by its ID.

Parameters

id 🔢 integer
The inventory's ID.

Returns

📋 table | ✅ boolean
The inventory object or false if not found.
📝 string
Error message if not found.

FrameworkZ.Inventories:GetItemByUniqueID(inventoryID, uniqueID)

method
Get an item by its unique ID from a specific inventory.

Parameters

inventoryID 🔢 integer
The inventory's ID to search in.
uniqueID 📝 string
The item's unique ID.

Returns

📋 table | ✅ boolean
The item object or false if not found.
📝 string
Error message if not found.

FrameworkZ.Inventories:GetItemCountByID(inventoryID, uniqueID)

method
Get the count of items with a specific unique ID in an inventory.

Parameters

inventoryID 🔢 integer
The inventory's ID to search in.
uniqueID 📝 string
The item's unique ID.

Returns

🔢 integer | ✅ boolean
The count or false if inventory not found.
📝 string
Error message if failed.

FrameworkZ.Inventories:Initialize(id, object)

method
Initialize an inventory.

Parameters

id 📋 table
The inventory's id.
object 📋 table
The inventory's object.

Returns

🔢 integer
The inventory's ID.

FrameworkZ.Inventories:IsFrameworkZItemType(itemType)

method
Check if an item type is a FrameworkZ item (O(1) lookup)

Parameters

itemType 📝 string
The full item type (e.g., "Base.Hat_Beanie")

Returns

✅ boolean
True if it's a FrameworkZ item

FrameworkZ.Inventories:New(username, type, id)

method
Create a new inventory object.

Parameters

username 📝 string
The owner's username. Can be nil for no owner.
type 📝 string
The type of inventory. Can be nil, but creates a character inventory type by default. Refer to FrameworkZ.Inventories.Types table for available types.
id 📝 string
The inventory's ID. Can be nil for an auto generated ID (recommended).

Returns

📋 table
The new inventory object.

FrameworkZ.Inventories:Rebuild(isoPlayer, inventory, items)

method
Recursively traverses the inventory table for missing data while referencing the item definitions to rebuild the inventory.

Parameters

inventory 📋 table
The inventory to rebuild.

Returns

📋 table
The rebuilt inventory.

FrameworkZ.Inventories:Restore(character, inventoryData)

method
Restore character inventory and equipment data

Parameters

character 📋 table
The character object
inventoryData 📋 table
The saved inventory data

Returns

✅ boolean
Whether restoration was successful

FrameworkZ.Inventories:RestoreEquipment(character, inventoryData)

method
Restore all equipment (both physical and logical) for a character

Parameters

character 📋 table
The character object
inventoryData 📋 table
The complete inventory data containing equipment info

Returns

✅ boolean
Whether restoration was successful

FrameworkZ.Inventories:RestoreItemData(item, itemData)

method
Restore comprehensive item data from saved data

Parameters

item 🏷️ InventoryItem
The item to restore to
itemData 📋 table
The saved item data

Returns

✅ boolean
True if restoration was successful

FrameworkZ.Inventories:RestoreLogicalItems(character, logicalInventoryData)

method
Restore equipped FrameworkZ items (logical items) - DEPRECATED: Use RestoreEquipment instead

Parameters

character 📋 table
The character object
logicalInventoryData 📋 table
The logical inventory data containing equipped items

Returns

✅ boolean
Whether restoration was successful

FrameworkZ.Inventories:Save(character)

method
Save character inventory and equipment data

Parameters

character 📋 table
The character object with inventory

Returns

📋 table
The complete inventory data including equipment