> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/2.4/api/csharp/yarn.unity/yarn.unity.dialoguerunner/yarn.unity.dialoguerunner.loadstatefrompersistentstorage.md).

# LoadStateFromPersistentStorage(string)

Method in [DialogueRunner](/2.4/api/csharp/yarn.unity/yarn.unity.dialoguerunner.md)

## Summary

Loads all variables from the requested file in persistent storage into the Dialogue Runner's variable storage.

```csharp
public bool LoadStateFromPersistentStorage(string saveFileName)
```

## Remarks

This method loads the file `saveFileName` from the persistent data storage and attempts to read it as JSON. This is then deserialised and loaded into the [VariableStorage](/2.4/api/csharp/yarn.unity/yarn.unity.dialoguerunner/yarn.unity.dialoguerunner.variablestorage.md).

The loaded information can be stored via the [SaveStateToPersistentStorage(string)](/2.4/api/csharp/yarn.unity/yarn.unity.dialoguerunner/yarn.unity.dialoguerunner.savestatetopersistentstorage.md) method.

## Parameters

| Name                  | Description                                                              |
| --------------------- | ------------------------------------------------------------------------ |
| `string` saveFileName | the name the save file should have on disc, including any file extension |

## Returns

`true` if the variables were successfully loaded from the player preferences; `false` otherwise.
