# Using the Save Storage

{% hint style="success" %}
The save storage is unnecessary in [ESave Pro](https://u3d.as/3vCT).
{% endhint %}

The purpose of the save storage is simple—it helps find saves by storing their file path. Read more about this [here](/esave/getting-started/components/save-storage.md).

{% hint style="info" %}
When scripting with the Save Storage, ensure that there is a Save Storage component in your scene.
{% endhint %}

## Adding to the Storage

Save files that have `addToStorage` set to true will automatically be added to the save storage. Ensure that there is a Save Storage component in your scene. You can also add the save file to the storage with the code below.

```csharp
// Where save is a SaveFile reference
SaveStorage.instance.AddSave(save);
```

## Removing From the Storage

Removing saves from the storage is useful when you'd like the player to have the option to delete a save state.

```csharp
// Where save is a SaveFile reference
SaveStorage.instance.RemoveSave(save);
```

## Accessing the Saves

### Get All Saves

You can get the list of all saves with the code below.

```csharp
var allSaves = SaveStorage.instance.saves;
```

### Get a Save By File Name

```csharp
var save = SaveStorage.instance.GetSaveByFileName("name");
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://espergames.gitbook.io/esave/scripting/using-the-save-storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
