Thank you so much! I was having issues with saving and loading but this tutorial has been so concise and easy to follow and worked perfectly for me. :D
I would like to put out there that if anybody has been trying to get saving to work and you followed step by step but still doesn't work, Try saving and closing the engine down and restarting.. I had a bug today that made me think i was crazy, 5 hours of my life wasted.. I normally know how to do this but when it wasn't working i started to question myself but it turned out to be a bug after restarting the engine and recreating some references things actually saved and loaded :S DAMN YOU EPIC!! do some bug crushing please!!
hi, thx for the tuorial, i have a similar save/load metod, but in the game instance, for a long time this work fine, but now, in cant load the game when i compile my project, but if i try in the engne, this work fine, what is the problem? in the past mounts this work perfect
What do you mean you can't load the game when you compile your project but you can in engine? Every project must be "compiled" to run whether in engine or as a stand alone. Do you mean the save/load system works when you play in editor but not in a "packaged" build?
@@NebulaGamesInc this is correct, "Do you mean the save/load system works when you play in editor but not in a "packaged" build?" i try to see what is the problem, but i cant find nothing, sorry for my english
@@NebulaGamesInc When I try the packaged version for a few seconds, the saved values are loaded, but the next second they are reset and reloaded by default, I have a check in my main menu, if I have a save, open the main menu, but if not I have, open a menu to choose character, when I start the game again it should open the main menu, but it continues to open the menu to choose character, this with a boolean, which by default is true, I named it "first contact"
When you package a game it will not have saved data from the play in editor version. You have to play the packaged build, save the packaged build and then load from the packaged build. You can't play the editor version, save and then load that data up in a packaged build. I think that is the issue if I am understanding what you did correctly.
@@NebulaGamesInc I understand that, I did not mean to load the editor, I meant to load that game saved from the game that is in "users / appdata / etc, etc, I am testing certain configurations, I will continue investigating, thanks for your time
Thx for tutorial_!! How to save the information of each individual spawn actor of one class_?! For example, the text printed in the widget, which was created when this actor spawned_?!
For that I think this video will be more useful to you if you haven't checked it out already. It goes over how to save previously "killed" enemies so they don't show up again after a save/load cycle. ruclips.net/video/Qe1K4Z2qME0/видео.html In order to do exactly what you want however you will need to modify this a bit. You need to basically use the system I created for determining which enemies needed to be removed before the start of the level and instead you will use the integer variable I defined in the video to be exposed on spawn. You will need to give each spawned actor a different value which can easily be done by having an integer variable in the spawner "increment" itself and set the "index" as I called it in your spawned actor. You will also need to expose on spawn any variables that you want saved this way they can be re-added when the actors are spawned back after a save game (I suggest using a struct, this way you only have 1 variable to worry about keeping track of) When you save the game you will need to loop through all your actors as I did and save out the struct with the "index" included in that struct. When you load the game back up, you can loop through your saved set of structs, and spawn the actors in while setting their "struct" variable that was exposed to the values that were saved. If your actors will be present in the world and not dynamically spawned, you will need to "get all actors" loop through them and identify which index they have, then loop through the struct variables and find which index in the struct matches the index of the "get all actors" node and once you find the correct index, set the struct in the instanced actor to the struct values that you saved. I understand that is probably a lot and you will be confused but try and watch the video first and get the idea of what I am saying and then if you have more questions I will try and help once you have a basic system set up.
hello Mr Nebula, I am get an Error [Blueprint Runtime Error: "Accessed None trying to read property player Ref". Blueprint: RunHud Function: Execute Ubergraph Run Hud Graph: EventGraph Node: Set PlayerScore[save] please help me.
Not sure what exactly the issue is. Any functionality I created in the player character or wherever (it's been a while since I made this) could easily be moved to a different blueprint like a player controller or other such blueprint not requiring a direct pawn in the world.
I think in the later versions of Unreal you dont have to do that anymore, as for me in 4.22 game save works without setting the values after creating a new game slot.
so, i followed your tutorial, and all works except for a few things.. i start as one character, then "evolve" (by way of posessing) into another character. the save works just fine from my pause menu (HUD), but when i exit, and start the game from my main menu, (another HUD) and navigate to the load button, it doesnt work. how can i manage to fix this? do you have a tutorial somewhere for loading/saving via menus (HUDS)?
Don't have a specific tutorial for that. Sounds like you have flawed logic. Somewhere along your logic flow you're not loading the save game. If the save and load works from one HUD but not another I suggest going through each step from the non-working HUD and I bet you'll find the issue. You just have to be very meticulous going through your logic path.
@@NebulaGamesInc the only difference is that when setting everything up in the HUD to load the game, its set to initiate when the load button is pressed. do i also need to make a variable to save and load the level my character is in?
With save/load cycles I see a lot of people have difficulty because they don't keep track of the step by step process needed to actually "save" and "load" a game. The front end of a save/load cycle looks like the game just pauses your progress, shuts down and then when you hit load...starts back up again from the same spot. The reality is "saving" involves telling your computer to store data in the form of variables (i.e. remember) what the player did. Then when you "load" it actually reinitializes the entire game state. So spawning enemies, removing things that were destroyed or damaged during the last play session, updating the HUD for health, points, abilities etc. So in your case, it sounds like when you press the "load" button from your other HUD you are either not pulling in the proper saved data or you are not telling the computer how to use the data it pulled in. For example you may have a variable saved that says "score". When saving, you grab player score and save the value out to the save game object as an integer variable. When you load back up you grab the saved score value but you need to then have some code that tells the computer to use that value and change the widget in the HUD that keeps track of player score. Many things can go wrong in that pathway and it seems to me like you're logic isn't setup properly. So follow each step from button click to function calls to updating the player HUD or whatever it is you're doing and make sure you haven't left any steps out. Use print string to test that the data is flowing from one step to the next and I bet you will find the error.
@@NebulaGamesInc ok. Here's the thing with that.. I actually read a post you had very similar to that, and followed the tutorial step by step. Even set up the loading of the game in the level blueprint, with a key press, ending with a print string to show that it worked. All the variables, health, xp, shield, all loaded up. All I did was transfer that load setup into the HUD, set it to the load button clicked, and had to change just a few things, and all of a sudden it doesn't work. I'll go over everything again, even take screenshots if need be to show.
Question, how would I get the variable into Game Save? I tested the UMG buttons and they still swap out the clothing correctly. I even get the correct print string when the clothing swaps out at runtime. I uploaded screen grabs of the flow in the UE4 forums. My "Gave Save" button is not working or my "Load Game" button does not load the variable. forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1599868-create-character-customization-variables-for-game-save
Thank you so much! I was having issues with saving and loading but this tutorial has been so concise and easy to follow and worked perfectly for me. :D
Kudos bro! Quick and to the point! Life saver
I would like to put out there that if anybody has been trying to get saving to work and you followed step by step but still doesn't work, Try saving and closing the engine down and restarting.. I had a bug today that made me think i was crazy, 5 hours of my life wasted.. I normally know how to do this but when it wasn't working i started to question myself but it turned out to be a bug after restarting the engine and recreating some references things actually saved and loaded :S DAMN YOU EPIC!! do some bug crushing please!!
hi, thx for the tuorial, i have a similar save/load metod, but in the game instance, for a long time this work fine, but now, in cant load the game when i compile my project, but if i try in the engne, this work fine, what is the problem? in the past mounts this work perfect
What do you mean you can't load the game when you compile your project but you can in engine? Every project must be "compiled" to run whether in engine or as a stand alone. Do you mean the save/load system works when you play in editor but not in a "packaged" build?
@@NebulaGamesInc this is correct, "Do you mean the save/load system works when you play in editor but not in a "packaged" build?" i try to see what is the problem, but i cant find nothing, sorry for my english
@@NebulaGamesInc When I try the packaged version for a few seconds, the saved values are loaded, but the next second they are reset and reloaded by default, I have a check in my main menu, if I have a save, open the main menu, but if not I have, open a menu to choose character, when I start the game again it should open the main menu, but it continues to open the menu to choose character, this with a boolean, which by default is true, I named it "first contact"
When you package a game it will not have saved data from the play in editor version. You have to play the packaged build, save the packaged build and then load from the packaged build. You can't play the editor version, save and then load that data up in a packaged build. I think that is the issue if I am understanding what you did correctly.
@@NebulaGamesInc I understand that, I did not mean to load the editor, I meant to load that game saved from the game that is in "users / appdata / etc, etc, I am testing certain configurations, I will continue investigating, thanks for your time
Thx for tutorial_!!
How to save the information of each individual spawn actor of one class_?!
For example, the text printed in the widget, which was created when this actor spawned_?!
For that I think this video will be more useful to you if you haven't checked it out already. It goes over how to save previously "killed" enemies so they don't show up again after a save/load cycle.
ruclips.net/video/Qe1K4Z2qME0/видео.html
In order to do exactly what you want however you will need to modify this a bit. You need to basically use the system I created for determining which enemies needed to be removed before the start of the level and instead you will use the integer variable I defined in the video to be exposed on spawn. You will need to give each spawned actor a different value which can easily be done by having an integer variable in the spawner "increment" itself and set the "index" as I called it in your spawned actor. You will also need to expose on spawn any variables that you want saved this way they can be re-added when the actors are spawned back after a save game (I suggest using a struct, this way you only have 1 variable to worry about keeping track of) When you save the game you will need to loop through all your actors as I did and save out the struct with the "index" included in that struct. When you load the game back up, you can loop through your saved set of structs, and spawn the actors in while setting their "struct" variable that was exposed to the values that were saved. If your actors will be present in the world and not dynamically spawned, you will need to "get all actors" loop through them and identify which index they have, then loop through the struct variables and find which index in the struct matches the index of the "get all actors" node and once you find the correct index, set the struct in the instanced actor to the struct values that you saved. I understand that is probably a lot and you will be confused but try and watch the video first and get the idea of what I am saying and then if you have more questions I will try and help once you have a basic system set up.
hello Mr Nebula, I am get an Error [Blueprint Runtime Error: "Accessed None trying to read property player Ref". Blueprint: RunHud Function: Execute Ubergraph Run Hud Graph: EventGraph Node: Set PlayerScore[save] please help me.
Seems like you either don't have a player character in your level at the time you try and save or you didn't reference the player properly.
Soo... That i would doing if in my game i dont have any player character(it's mobile RTS and I only watch by camera actor)
Not sure what exactly the issue is. Any functionality I created in the player character or wherever (it's been a while since I made this) could easily be moved to a different blueprint like a player controller or other such blueprint not requiring a direct pawn in the world.
I think in the later versions of Unreal you dont have to do that anymore, as for me in 4.22 game save works without setting the values after creating a new game slot.
Why does the video have unlike?
Clearly someone was not happy with the content 🤷♂️ can't please everyone ha
so, i followed your tutorial, and all works except for a few things.. i start as one character, then "evolve" (by way of posessing) into another character. the save works just fine from my pause menu (HUD), but when i exit, and start the game from my main menu, (another HUD) and navigate to the load button, it doesnt work. how can i manage to fix this? do you have a tutorial somewhere for loading/saving via menus (HUDS)?
Don't have a specific tutorial for that. Sounds like you have flawed logic. Somewhere along your logic flow you're not loading the save game. If the save and load works from one HUD but not another I suggest going through each step from the non-working HUD and I bet you'll find the issue. You just have to be very meticulous going through your logic path.
@@NebulaGamesInc the only difference is that when setting everything up in the HUD to load the game, its set to initiate when the load button is pressed. do i also need to make a variable to save and load the level my character is in?
@@NebulaGamesInc and i'm currently streaming on twitch while working on this bc for whatever reason, ue4 crashes a lot when i don't stream. lol
With save/load cycles I see a lot of people have difficulty because they don't keep track of the step by step process needed to actually "save" and "load" a game. The front end of a save/load cycle looks like the game just pauses your progress, shuts down and then when you hit load...starts back up again from the same spot. The reality is "saving" involves telling your computer to store data in the form of variables (i.e. remember) what the player did. Then when you "load" it actually reinitializes the entire game state. So spawning enemies, removing things that were destroyed or damaged during the last play session, updating the HUD for health, points, abilities etc. So in your case, it sounds like when you press the "load" button from your other HUD you are either not pulling in the proper saved data or you are not telling the computer how to use the data it pulled in. For example you may have a variable saved that says "score". When saving, you grab player score and save the value out to the save game object as an integer variable. When you load back up you grab the saved score value but you need to then have some code that tells the computer to use that value and change the widget in the HUD that keeps track of player score. Many things can go wrong in that pathway and it seems to me like you're logic isn't setup properly. So follow each step from button click to function calls to updating the player HUD or whatever it is you're doing and make sure you haven't left any steps out. Use print string to test that the data is flowing from one step to the next and I bet you will find the error.
@@NebulaGamesInc ok. Here's the thing with that.. I actually read a post you had very similar to that, and followed the tutorial step by step. Even set up the loading of the game in the level blueprint, with a key press, ending with a print string to show that it worked. All the variables, health, xp, shield, all loaded up. All I did was transfer that load setup into the HUD, set it to the load button clicked, and had to change just a few things, and all of a sudden it doesn't work. I'll go over everything again, even take screenshots if need be to show.
How would you save the visibility of child mesh in the Third Peron Character into an ENUM then save that ENUM index into Game Save?
You would have to create an enum with the visibility options you want and then save it as you would any other variable.
Question, how would I get the variable into Game Save?
I tested the UMG buttons and they still swap out the clothing correctly. I even get the correct print string when the clothing swaps out at runtime.
I uploaded screen grabs of the flow in the UE4 forums.
My "Gave Save" button is not working or my "Load Game" button does not load the variable.
forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1599868-create-character-customization-variables-for-game-save
I responded on the forum.
i have another question, how can i load this information in a client? i try but the client loads the values from character 0 (server)
Never messed around with multiplayer so unfortunately can't help you on this one.