> For the complete documentation index, see [llms.txt](https://reekcoder.gitbook.io/mon-bazou-sse-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reekcoder.gitbook.io/mon-bazou-sse-docs/quickstart.md).

# Getting Started

After installing SSE into Mon Bazou and adding it as a dependency to your project, you're ready to begin. It's recommended to enable `List Loaded Mods` in the **BepInEx** config file. This feature shows the names of loaded mods when you start your save.

If you'd like to test or refer to an example mod, I’ve created one called [SaveableCubeExample](https://github.com/ReekCoder/SaveableCubeExample).

***

## Initialization

Add Using Statement

```csharp
using SaveSystemExtension;
```

Create a reference to your save file data, It's recommend to make it easily accessible.

```csharp
public static ModSaveData modSaveData;
```

### Awake/Start

This code creates your mod save data and attaches your functions to the appropriate save and load events. Ensure you use the correct loading event handlers to avoid unexpected loading behavior.

```csharp
private void Awake()
{
    // Create Save Data For API
    modSaveData = new ModSaveData(PLUGIN_NAME, PLUGIN_GUID);

    //Create Save And Load Events
    SaveTools.OnLoadItems += OnItemsLoad;
    SaveTools.OnSave += Save;
}
```

***

### Data Loading

```csharp
private void OnItemsLoad()
{            
    // Set And Add Variables To Save System Or Load Them, If They Already Exist.
    Vector3 savedVector = modSaveData.AddDataToSave(Vector3.zero, "VarName");
    
    //Load Vector Data Into Active GameObject
}
```

***

### Data Saving

```csharp
private void Save()
{
    // Write GameObject Position To Mod Object Data
    modSaveData.WriteDataToSave(Transform.position, "VarName");
}
```

***

## Custom Data Class

I'll finish this part later. ([SaveableCubeExample](https://github.com/ReekCoder/SaveableCubeExample) shows a custom data class in use)

***

## Notes

* When creating custom interactables or vehicles, always use `SaveTools.BlockFromMainSave()`.  Failing to do so can cause errors on loading that may affect the player's game.
