# 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](https://cowsinss-organization.gitbook.io/save-and-load-add-on/content/03.-content/03.7-triggers/savetrigger) or [LoadTrigger](https://cowsinss-organization.gitbook.io/save-and-load-add-on/content/03.-content/03.7-triggers/loadtrigger).&#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](https://cowsinss-organization.gitbook.io/save-and-load-add-on/content/03.-content/03.1-datapersistence#how-does-the-save-and-load-system-work)
* [DataPersistenceManager](https://cowsinss-organization.gitbook.io/save-and-load-add-on/content/03.-content/03.1-datapersistence/datapersistencemanager)
* [ObjectsSaveData](https://cowsinss-organization.gitbook.io/save-and-load-add-on/content/03.-content/03.5-objects-save-data)
* [CustomSaveData](https://cowsinss-organization.gitbook.io/save-and-load-add-on/content/03.-content/03.5-objects-save-data/customsavedata)
* [Saving Custom Data: Simple Method](https://cowsinss-organization.gitbook.io/save-and-load-add-on/how-to-use-and-guides/saving-custom-data-simple-method)
* [Saving Custom Data: Advanced Method](https://cowsinss-organization.gitbook.io/save-and-load-add-on/how-to-use-and-guides/saving-custom-data-advanced-method)
