> For the complete documentation index, see [llms.txt](https://cowsinss-organization.gitbook.io/save-and-load-add-on/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cowsinss-organization.gitbook.io/save-and-load-add-on/how-to-use-and-guides/save-and-load-games-programmatically.md).

# Save & Load Games Programmatically

With the Save & Load Add-On, saving and loading games is very easy!\
To save and load your game, you will need to access the `DataPersistenceManager`. Whenever you're working with or coding for the Save & Load Add-On, be sure to include the `cowsins.SaveLoad` library at the top of the script.

```csharp
using cowsins.SaveLoad; // Gives us access to DataPersistenceManager
```

After that, just call either `SaveGame()` or `LoadGame()`, depending on whether you want to save or load the game.

### Saving Game through DataPersistenceManager

```csharp
DataPersistenceManager.instance.SaveGame();
```

### Loading Game through DataPersistenceManager

```csharp
DataPersistenceManager.instance.LoadGame();
```

### Examples of Scripts that Programmatically Save or Load the Game

In case you want to take a look at a script provided within the Save & Load Pro Add-On that handles Save & Loading programmatically, you can check [SaveTrigger](/save-and-load-add-on/content/03.-content/03.7-triggers/savetrigger.md) or [LoadTrigger](/save-and-load-add-on/content/03.-content/03.7-triggers/loadtrigger.md).&#x20;

### More Important Information

To successfully add Custom Implementations with Save & Load Pro Add-On, you need to understand how the system works. Please, refer to the following Documentation Sections for further explanation:

* Understanding how the Entire System works: [03.1 Data Persistence](/save-and-load-add-on/content/03.-content/03.1-datapersistence.md#how-does-the-save-and-load-system-work)
* [DataPersistenceManager](/save-and-load-add-on/content/03.-content/03.1-datapersistence/datapersistencemanager.md)
* [ObjectsSaveData](/save-and-load-add-on/content/03.-content/03.5-objects-save-data.md)
* [CustomSaveData](/save-and-load-add-on/content/03.-content/03.5-objects-save-data/customsavedata.md)
* [Saving Custom Data: Simple Method](/save-and-load-add-on/how-to-use-and-guides/saving-custom-data-simple-method.md)
* [Saving Custom Data: Advanced Method](/save-and-load-add-on/how-to-use-and-guides/saving-custom-data-advanced-method.md)
