Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: Not Selected
more ▼

asked Mar 17 '15 at 02:21 PM in Blueprint Scripting

avatar image

1k 83 75 118

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hi Stormrage256,

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!

more ▼

answered Mar 18 '15 at 01:18 AM

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Mar 17 '15 at 03:22 PM

avatar image

1k 165 164 354

avatar image Stormrage256 Mar 17 '15 at 04:05 PM

Thanks, I don't have the save game requirement. I only need to store upon death. So I guess I can do a similar thing with the player controller instead. When I spawn and possess a new character, I can take the necessary values from controller and put in character BP.

avatar image Jurif Mar 17 '15 at 08:04 PM

You could create a new Inventory class (Actor) , and have inventory data there. I like to keep most of my game related stuff inside GameMode , there is only one GameMode running so it can be used to keep references to all other important classes and it's contents, a simple solution is to keep the game play stuff right inside GameMode , or as I said you create another class to keep things neat.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question