x

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"

Save variables from multiple blueprints

Hi,

I'm looking online for some time at tutorials about saving variable in UE4 and all use the same logic to them. In every tutorial after casting to "save game to slot" the save game object is promoted to a variable in that blueprint. My question is: if I want save other variables that are in a different blueprint what do I have to do about the save game object because it was promoted to a variable that is in a different blueprint.

Thank you

Product Version: UE 4.22
Tags:
more ▼

asked May 04 '19 at 11:11 AM in Blueprint Scripting

avatar image

Bogdan00001
10 1 3

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

1 answer: sort voted first

"Load Game from Slot" returns the Save Game Object reference you need. As long as you know in what slot you save your game, you can create a new reference to the save file with this node.

Then you can just copy the variables from each blueprint into the Save Game Object locally.

Another way to make it work would be to store the SaveGame Reference in a central BP, like the GameInstance or GameMode. This way you can reference is with the "get Gamemode"/"Get GameInstance"-Nodes and then cast to access the membervar that is the Ref to your savegame object.

more ▼

answered May 04 '19 at 12:03 PM

avatar image

J-man1992
125 5 12 16

avatar image Nebula Games Inc May 04 '19 at 03:17 PM

If you check out video #21 in the link below I go over how to perform a "Save/Load" cycle. As J-man1992 states it uses the game instance so this blueprint along with the save game variable can be accessed from any other blueprint and across multiple levels.

https://www.youtube.com/playlist?list=PLyu-W38DvZhqByAoeva1jewB5s78zQHIy

avatar image Bogdan00001 May 05 '19 at 09:23 AM

Hi,

Thank you for the answers J-man1992and Nebula Games Inc . I was thinking of using a game instance after I saw a video on it yesterday. I will also look at all the youtube video, i for sure learn new things.

(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