Where to store important character specific data like inventory details?
Hi, I'm working on the default first person template and I was wondering where to store data such as inventory that can be retrieved even after the character has died and respawned. At the moment, all the character specific data is inside my character blueprint. But before continuing any further, I would like to know the ideal workflow related to storing important persistent variables. And I do not need to move this data across multiple levels. I just need to store the data from level start till level end.
asked Mar 17 '15 at 02:21 PM in Blueprint Scripting
The PlayerState is a good place to put things like score, player details, and other data you want to remain saved. This also allows the information to be replicated to other clients, a good thing if you start messing with multiplayer. You can create a custom PlayerState by creating a new Blueprint and searching for that class. Then you can set that PlayerState as your default in the GameMode. More information on setting that up can be found here:
Hope that helps!
answered Mar 18 '15 at 01:18 AM
Any important variables that are involved with the player should be Done in the player BP probably. That way you create your save game blueprint you can pull it in and out of you character BP easily and save all of those variables to SAVED versions of this variables in ur save game bp. And then load the opposite way when needed.
answered Mar 17 '15 at 03:22 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here