Using 'save / load game' to remember inventory items

Hello,

I have used the Unreal Engine tutorial on YouTube to create an inventory system. My question is: How can I get items that the player has picked up to save upon quitting the game, opening it back up and then loading from the save game. At the moment, I can pick items up, save and load and the items will still be in my inventory. However if I quit the game, then load from the slot it doesn’t remember the items?

Any help would be greatly appreciated :slight_smile:

Hi man , you have to use a saveslot sistem…
The variable you put in the saveslot will be write down to a file in the pc.
here the two link to the documentation

https://docs.unrealengine.com/latest/INT/Gameplay/SaveGame/Blueprints/index.html

Hey, thanks for replying so quickly! I apologise but I’m not sure what you mean, I’m quite new to unreal. I have uploaded an image of my save system. Basically I am getting the inventory array and setting that to a variable within my savedgames BP class. Within the load game below, I reverse the opposite (the same way I have done my health, stamina etc.) but it doesn’t seem to work :frowning:

Take a look at this image , from the previous links.

As you can see, to successfully save the variables and load them, you have to create a saveslot(of your type). My saveslot is called PLAYER_STATS. inside there are variable for life and ammo and other status.
Once you have created the saveslot, you access to his variables to set them all correctly.
Then you can save your saveslot on your pc. giving him a name.

If you want to load these info you have to be sure that you saved them correcly, so check with some print event if any of your “cast to” get fail.

Sorry for digging up here, but I have the same problem as you. Basically, the game should be divided into levels (different maps), so one of the things I save in my custom SaveGame Blueprint is the name of the current level. The basic BP saved only the Level Name and Player Transform (to position him where I saved, upon loading).

The problem is, it saves perfectly, and loads perfectly (I tested upon playing the same level, just with Player Transform), however, when I quit to the main menu (which opens the Menu level), and press Load Game, it loses everything it should load when it loads the Level, since even the GameMode seems to not be persisting.

Looking to find an answer as well, meanwhile, will work with the quickload stuff, inserting more player data to the SaveBP…

Okay I hope this makes sense. When you do your save action you are setting the saved inventory to the current inventory array. Good. Then, in the game mode you use for your game, open it up and add an on event begin play. On begin play get the character and set its inventory to the saved inventory from slot. In this event you can also set the transform, health, ect.

Use a GameInstance to store data that you want to persist between opening levels.

HI,
I have a similar problem after following the same unreal tutorial only my saved game doesn’t work at all! Have you found any solution? and if yes can you share your method? It would be greatly appreciated because I’ve been throwing myself against the wall for more than a month trying to solve it.
Thanks