Storing game information using Save Game Object

The first step we need to perform in order to create a save system is to create a new kind of Blueprint that will store the game data that we want to save. Go to the Content Browser and open the Blueprints folder. Click on the Add New button, select Blueprints, and then click on Blueprint Class. In the window that appears, search for and select SaveGame to create a new Blueprint of that class. Name this Blueprint SaveSystem, and then double-click on it to open the Blueprint.

This Blueprint will contain our variable stored for the saved data:

In our case, we are going to implement a series of increasingly difficult rounds, so we want to track which round the player was on before they quit the game. We do not need to store any data on how many enemies the player has killed because it would make more sense to the player for each game session to start at the beginning of a round. To track the current round, create a new variable called CurrentRound from the My Blueprint panel. Change Variable Type to Integer, and then mark the variable as Instance Editable. Compile the Blueprint and set its Default Value to 1. That's all we need to do in SaveSystem. Compile again and save the Blueprint now.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset