VaultLogic
  • Welcome
  • Getting Started
    • Quickstart
  • Code & Design
    • Items
      • Vault Item
      • Stackable Item
      • Item Definition Patterns
    • Components
      • Vault Component
      • Collectable Component
    • Persistence
      • Item Serialization
      • Inventory Serialization
Powered by GitBook
On this page
  1. Code & Design
  2. Persistence

Inventory Serialization

PreviousItem Serialization

Last updated 4 months ago

For serializing an inventory component (assuming you are using the included serialization method) you simply need to call the SaveInventory function in your inventory.

This function will output a serializable structure that includes the contents and the ID to distinguish this inventory from the rest. You simply save the output of this function to a variable in your SaveGame object and then when loading it, you can call LoadFromSave which will receive the structure you saved in the previous step and recreate the inventory from it.