Save Menu
The Save Menu lets a player choose a local slot, then save, load, overwrite, or delete it. The menu displays and selects slots; the Save System Manager writes the files, while Saver components decide which game state belongs in each slot.
Use the menu for a manual save flow such as preserving three Health Potions in Bag, an Iron Sword in Equipment, and the player’s Gold balance. The released Version 1 menu uses one global Save System Manager, so opening it from a particular character does not limit the operation to that character.
Before you begin
Set up and test the Save System before creating its menu:
- Open Tools > Opsive > Ultimate Inventory System > Main Manager.
- Select Setup, then open Save Setup.
- Assign the player GameObject to Object to save and select Add Components.
- Confirm that Save System Manager and Inventory System Manager Item Saver are on the Inventory System Manager GameObject.
- Confirm that Inventory Saver is on the player. Add Currency Owner Saver when Gold should persist.
For a normal restore, leave Additive disabled on Inventory Saver. The Inventory System Manager Item Saver is also required when Items have runtime state, such as an Iron Sword whose Durability changes.
For the first manual test, leave the manager’s four automatic load and save options disabled. Its released Version 1 defaults are Max Saves 5, Save File Name SaveFile, Save File Extension save, and Save Meta Data File Extension metadata. Leave Save Meta Data Creator unassigned to use the built-in date-and-time summary.
Create the Save Menu
- Open Tools > Opsive > Ultimate Inventory System > UI Designer.
- Select the Save tab and open Create.
- Assign the Parent Transform that should contain the menu.
- Choose a Panel Option:
- Basic creates a standalone Save Menu.
- Main Menu adds a Save/Load inner panel. For this option, Parent Transform must be the Main Menu’s main content transform.
- Select Create.
- In the Edit section, select the generated menu. Use Find Available Targets in Scene if it is not already selected.
The UI Designer also exposes Save System Manager and Savers, Grid Size & Layout Group, and Grid Navigation. Use the first section to audit the Saver components found in the scene. Use the grid sections to make every configured slot reachable by mouse, keyboard, or controller.
For a detailed walkthrough of the generator and its grid controls, see UI Designer: Save.
Connect the runtime components
The generated hierarchy should already be connected. Verify these references before customizing its layout:
| Component | Field | Expected reference or value |
|---|---|---|
| Save Menu | Save Grid | The generated slot grid |
| Save Grid | Action Panel | The panel that presents Save, Load, and Delete |
| Save Grid | Confirmation Pop Up | The confirmation dialog used for overwrite, load, and delete |
| Save Grid | Optional Save Event | Disabled for the built-in save action |
| Save Grid | Optional Load Event | Disabled for the built-in load action |
| Save Grid | Optional Delete Event | Disabled for the built-in delete action |
| Save View Module | File Number Format | {0:00} by default |
| Save View Module | File Number Text | The text element that displays the slot number |
| Save View Module | Save Content Text | The text element that displays Empty, a date, or custom metadata |
Enabling an optional event cancels the corresponding built-in operation. Its callback must perform the replacement save, load, or delete itself; an event that only plays feedback leaves the slot unchanged.
Keep the visible grid and its navigation within the manager’s valid indexes, from 0 through Max Saves – 1. Do not leave selectable padding cells beyond that range.
Understand slot data and ownership
Each occupied slot has a main .save file and a separate .metadata file under Application.persistentDataPath. The lightweight metadata lets the menu list slots without loading their full Inventory data. With the built-in metadata creator, an occupied Save View displays the save date and time; an empty view displays Empty.
Saving asks every registered Saver for its current state. Loading applies every registered Saver in dependency order. This means:
- Inventory Saver controls Bag and Equipment membership;
- Inventory System Manager Item Saver preserves the Item records and mutable values referenced by that Inventory;
- Currency Owner Saver controls Gold; and
- specialized UI savers are needed when hotbar assignments or grid positions must also persist.
The Save Menu has no Inventory Identifier or per-player owner field. In local multiplayer, selecting slot 0 from either player’s menu saves or loads all Savers registered with the one Save System Manager. Separate player profiles require project-specific slot ownership or separate persistence orchestration; the built-in menu does not provide that boundary.
How it runs
- Opening the Display Panel initializes the Save Grid when necessary.
- The menu refreshes the grid from the Save System Manager’s current slot metadata and selects the first button.
- Selecting a slot opens the Action Panel.
- Save writes immediately when the selected entry has no metadata; otherwise it asks for overwrite confirmation.
- Load and Delete ask for confirmation before calling the Save System Manager.
- After an action, the grid refreshes so its slot labels match the manager’s current metadata.
The released Version 1 implementation creates a non-null, empty metadata object for an unused slot. The Save View correctly labels it Empty, but the built-in action conditions test only whether metadata is null. As a result, an Empty entry can still expose Load and Delete, and Save can ask for overwrite confirmation. Treat Empty as unsaved: use Save, do not use Load or Delete, or customize Save Grid so its conditions also check MetaData.IsEmpty.
Editor checkpoint
Before entering Play Mode, confirm that:
- one Save System Manager exists and Max Saves matches the intended slot count;
- Inventory System Manager Item Saver is present and assigned or resolvable from the manager;
- the player has an active Inventory Saver with the correct Inventory reference;
- Currency Owner Saver is present when Gold should persist;
- every Saver has a unique full key;
- Save Menu, Save Grid, Action Panel, Confirmation Pop Up, and Save View text references are assigned;
- the number of reachable slot buttons does not exceed Max Saves;
- optional events are disabled unless complete replacement operations are connected; and
- each supported input method can navigate the grid and confirmation popup.
Verify in Play Mode
Use a complete round trip rather than confirming only that a file appears:
- Start with three Health Potions in Bag, an Iron Sword in Equipment, and a known Gold balance.
- Open the Save Menu. Confirm that unused entries display Empty and that the first entry is selected.
- Choose Save on an Empty entry. Accept the overwrite prompt if Version 1 displays one, then confirm that the entry changes to a date and time.
- Remove two Health Potions, unequip the Iron Sword, change its runtime Durability if applicable, and spend some Gold.
- Choose Load on the occupied entry and accept the prompt. Confirm that Bag, Equipment, Durability, and Gold match the saved state.
- Change the state again, choose Save on the occupied entry, and confirm the overwrite. Load it and verify that the newer state replaced the earlier one.
- Choose Delete on the occupied entry. Confirm that it returns to Empty. Do not select Load or Delete on that empty entry even if Version 1 still enables those actions.
- Save again, stop and restart Play Mode, then open and load the entry. This confirms that the data came from disk rather than only the manager’s runtime cache.
- Repeat the selection and confirmation flow with every supported input method and every valid slot.
Troubleshooting
| Symptom | Check | Fix |
|---|---|---|
| The menu opens but selecting a slot does nothing | Save Grid, Action Panel, Confirmation Pop Up, and the parent Display Panel references | Reassign the generated references, then reopen the panel |
| An Empty entry offers Load or Delete, or Save asks to overwrite it | The view uses MetaData.IsEmpty, but released Version 1 action conditions check only whether metadata exists |
Use Save for Empty entries and avoid Load/Delete, or customize Save Grid to include the empty-state check |
| Save, Load, or Delete produces only feedback | The corresponding Optional … Event is enabled | Disable it to restore the built-in operation, or make the callback invoke the replacement operation |
| A blank button beyond the final slot can be selected | The grid exposes more selectable cells than Max Saves | Match the visible/navigation range to indexes 0 through Max Saves – 1 |
| The slot changes to a date, but Bag or Equipment does not return | Inventory Saver is missing, inactive, unregistered, or points at the wrong Inventory | Add or reconnect Inventory Saver and load after its Start registration; keep Additive disabled for replacement |
| Iron Sword returns without its runtime values | Inventory System Manager Item Saver is missing or not assigned | Add the saver to the Inventory System Manager and connect it to Save System Manager |
| Gold does not return | Currency Owner Saver is absent or references the wrong Currency Owner | Add and configure Currency Owner Saver on the owner of the tested Gold balance |
| Loading duplicates Items | Additive is enabled on Inventory Saver | Disable Additive unless merging is intentional |
| A menu opened by one local player restores both players | The menu calls the global Save System Manager and all registered Savers | Add project-specific profile and ownership rules; do not treat the built-in menu as player-scoped |
| A deleted or interrupted slot behaves inconsistently | Only one of its .save and .metadata files exists |
Back up the save folder, remove the orphaned pair, and create a fresh slot |
| The menu works until a scene transition | The manager or required Savers do not survive, register, or load in the expected order | Choose a consistent lifetime and load after the destination Savers register; see Scene Transitions |
Related pages
- Save System explains manager settings, Saver responsibilities, slot files, and release boundaries.
- UI Designer: Save covers the generated hierarchy and layout workflow.
- Save View explains how slot metadata is presented.
- Main Menu covers the parent panel used by the Main Menu option.
- Split-Screen Co-op UI explains player-owned UI and the global Save System boundary.
- Scene Transitions covers manager, player, and Saver lifetime across scenes.
- Events explains the shared event registration pattern.
Developer, event, and release boundaries
SaveGrid.Save(index), Load(index), and Delete(index) forward to SaveSystemManager.Save, Load, and DeleteSave. Refresh() reads SaveSystemManager.GetSaves(). Override these virtual methods when the panel should delegate to another backend, and keep the optional-event behavior in mind so one click does not run two persistence paths.
The manager publishes slot-index events before and after save, load, and delete operations: c_WillStartSaving_Index, c_SavingComplete_Index, c_WillStartLoadingSave_Index, c_LoadingSaveComplete_Index, c_WillDeleteSave_Index, and c_DeleteSaveComplete_Index. Register and unregister listeners during matching Unity lifecycle methods.
Deleting a damaged slot is not transactional in released Version 1. The built-in delete path returns early if the data file is missing, and it can also return before clearing the in-memory entry when the metadata file is missing. Repair an orphaned pair outside the normal menu flow after taking a backup.
The built-in Save Menu and Save System provide local files only. They do not add cloud conflict handling, encryption, save migration, backups, network authority, or separate player profiles. Add those policies in a project-owned persistence layer and use the optional events or an overridden Save Grid to connect it.