You're probably the only unreal tutorial guy i can stand for more that 2 minutes, so congrats on that. Great job with the paint explanation too. Keep it up!
Got it to work in 4.18. On the Save part exclude the Cast to Save Game. on the Load Game section on "Load Game From Slot" add the cast to save game and then continue with the video as normal.
oh man, i tried everything, but i dont get it what you mean. I use 4.21, i read below it works then, but i cannot figure out why it doesnt! cannot get the "set SaveGameSubclass" in the load area
That explanation was perfect!! The one you said you wanted people to leave a comment about. Nice job on this, man. It's really helped on a game I'm trying to make which switched between different levels very frequently.
I liked the paint diagram! Fantastic tutorial. Not everyone can explain things quite as well as you do in this tutorial. This was exactly what I needed.
For anyone looking at this tutorial now, a more modular way of doing this is to create a blueprint interface, and instead of saving with "Get all actors of class", use a "Get all actors with interface" node and add the interface to any actor you want to save.
is that any more beneficial than using Tags? (get all actor with tag) it seems like they are all equally slow processes? or i guess it depends on if you have lots of tags but few interface nodes ?
Yep great tutorial. Nice rhythm and tone to your voice (very important when you have to listen to somebody for a long time.) Made lots of sense. Keep it up. Hope you recovered from your injury / op as well !
This is the best tutorial I have seen in my entire life. I really appreciate you trying your best to explain things and you did do really well on that! I hope the blueprints are mostly the same 4 years later but either way thank you for this amazing video!
This video is amazing! It helped me understand new concepts, explained things in a way I could understand without seeming like it talked down to me, and moved along at a swift pace. I wish I could like a video more than once!
There was an issue i had when i did this loading the game from a MainMenu level. It turns out that the call to the function "Load Game from Save" validates the object references and breaks them if it cant find them, which means if you do not actually have the Level loaded up when you call that function, the list will be broken. For example I called that function from main menu, stored the array in a variable on Game Instance, then loaded the level, and then tried to read the array from the version in GameInstance, and the array was broken (number of entries was correct but each object reference was broken). So Instead I had to load the actual game world Level first, and THEN call the function from game instance to load the game, and then the object references worked.
Great video! Something must have changed in 4.18. When I try and connect the "Load Game From Slot" return value to Set "SaveGameSubClass" I get an error about Save Game Reference is not compatible. I have tried your video and another video and get the same error at the same place.
i believe you would basically make an array of the class types as a reference, then on Load, for each item in the array you SpawnActor (spawn / instantiate) using that class reference, and then apply the rest of the variables to it. it can be useful to use structs instead of multiple separate arrays ( so instead have a single array of a struct that has the location/class reference/other variables/etc, and build to/from that struct array)
Cool, I was working on some modular build project and was frustrating to place some actor and wen u come back on the game to not be any one there, now I get the point, and I understand how to make it. I mean I like because is not copy-paste like 'make this, connect that to there etc.' I can understand why I connect that to there :)
Man, I need help!!!!. How do you make it work on a build system? I'm trying but it only works for objects that were already in the landscape. When I try to load objects that I put after start playing, it does nothing, just load the player position and all that stuff.
This is great - but do you have a check for whether the actor still exists or is destroyed? Would you do a boolean array? or have an is valid check somewhere in here?
THANK YOU SIR!!! I got a bonus out of this! I had yet to figure out how to change the controller rotation, and now I can! Lmao thanks again! (P.S.: This works in the latest version, 4.24.3, as far as I can tell! Yippee!)
Good video~ I would say for anyone looking into this recently to try creating a Structure that contains a variable for class and for transform. Then maybe the process would run a little smoother maybe if it came to even larger maps. Ever since I understood structures, I think I fell in love with them lol. I am curious how well it would work across multiple maps since I would be uneasy to save their transform just by leaving a map. So maybe a temporary array / save file when leaving a map could be used to feed the final save file the updated info without having the chance to incorrectly save progress? It all depends on the design of the game, of course. I am trying for a farming/adventure game, currently. So that's why I wouldn't want to save it simply upon changing maps vs when the player decides to save the game. I think the loading part could check whether the temporary array has a length of one or more to decide whether to load from master save or temp save. Hopefully, what I said helps the thinking/building process for others. It helps me to type things to figure out some stuff.
Just watching back some old videos, i reckon we could make this more efficient by having the object store its transform and just saving the object.... Just a thought ^.^
Question, you are storing an array of transforms, and also an array of the instance that contains the same transform. Whould it be the same to not store the first array? and then when you want to load your level, you just perform a foreach stored instance, getActorTransform?
Awsome tutorial! Its an old video, but I realy hope someone can tell me why this is not working if the objects is teleported (not pushed arround) to a new location.. I set up a teleport by giving the actor a new location on overlap, but the new location isent saved.
I was also wondering if you could possibly help in setting this system up through a UMG save and load button? That would help tremendously. Great tutorial though! Thanks a lot!
Why do you have to build and break the transform instead of using getTransform and setTransform? I'm asking because I was like "oh thats dumb Ill just use this" and it didn't work so now I'm curious why these even exist
hey man i love your stuff! Somehow though it doesnt work for 4.21. I cannot set the SaveGameSubclass as a return value of the "load game from slot". In your video its 18:25. Whatever i try i dont get it running. It will save,.. i think :) But wont load! Have you any idea whats going wrong here?
I have an inventory system that i made in my game and i cant figure out how to save it for the life of me. Its slot based and I have no idea how to save the items that have been stored in the inventory. I can save the fact that theyve been removed from my inventory but not the fact that theyre in the storage. theyre basically just deleted
thank you, this works great for my rts game, but for some reason when I try to set the building hp from the array, my buildings end up damaged, I set it up so it grabs the class instead of the object and set a variable on the buildings for their hp, so when you call to spawn a building you can also set its hp directly, unfortunately its getting weird values >.
Hey do you have any idea about how to do something similar to find out whether or not an actor is destroyed so that it wont be spawned at all after loading? I can set a boolean on event destroyed but since the actor is then destroyed when doing the "get all actors of class - for each loop" it wont add anything to the arrays because the engine wont find any actors of that class.
Hey iv been wondering is it possible to load the characters saved position after opening a level iv been trying this and it knows the last saved location but doesnt move the character to that location
I'm trying to replicate this for allmost 3 days but it does not work in 4.9.2. There is some strange issue with ForEachLoop macro and it spoils whole setup. I can save pawn's transform but not the array's, keeps telling that 1) The Array is not compatible with Reference, 2) Later it begun to tell the ForEachLoop Array Target is undetermined... Is there a workaround? EDIT: OK I made this working but it only works with StaticMeshActor, it refuses to work for any kind of BP object I create like in the beginning of the tutorial.
hey, i think i know which your problem was. At the moment when you have to state, the two array variables for class, in the details panel, in the right side of the variable type scroll menu, there is a little symbol, that is made of 9 little squares, you have to click it to convert it to an array of that kind of variable. Then all will work. I just have one issue whit that, it happens that, even when you reset the Location,Rotation, and Scale. The load process don't stop the Momentum of any previous Physical force applied to the object
Thanks for the tip, anyway I think I will still need to use some higher inheritance level just to get everything possible into the array that can move in the level. Regarding your setup for class "class 1" you get only 1 class of objects out of all possible moving objects in the level, this script takes in matter only "class 1" objects. Thus there are two options, first build the script for all possible classes (no way) or use higher inheritance level which I believe is a way to go. I'm trying to move my understanding a bit further and as 80% of things were clouded 2 months ago, now it's much much better, thank you a lot for your script it really helped me to learn more about the engine. I composed your script directly into overlap saving script for my game thus when checkpoint happens, everything gets saved.
+Jamie Mulvaney I'm also looking for help with this. I followed these steps, but I'm trying to only allow the character to save while sleeping and load button is in a main menu widget so when I try to reference the save game sub class I'm unable to set a proper target.
+Jamie Mulvaney I'm trying to make a button that on clicked saves everything in the game. then I want to click another button in a different widget to load it all again.
+Jamie Mulvaney I'm trying to make a button that on clicked saves everything in the game. then I want to click another button in a different widget to load it all again.
+Behron Georgantas So I have an example showing you how to save and load from a menu's using buttons etc should be everything you need ! here is the link to download its a full project so you can see everything 1drv.ms/1W49d5o, one thing can you visit my youtube channel and thumbs up some of my development videos I have made documenting the development of my game would really help me out when the review comes
How can you actually save High Score that's connected to Game instance with Game Save object. I got the game instance working but dont know how to save . I have saving set up as well but integer + integer increment doesn't work with game save. If I incremented by 1 it always shows 1 on each trigger over lap.
new versions of unreal automatically casts the save game after you run "Create Save Game Object"... so for this example it was necesary, it seems also at that time it doesn't have a "Set Actor Transform" and he did a lot of work to set the transform
Hmmm, it doesnt seem to work for my game, Ive got the ability for the player to put down blocks and machines MineCraft Style and I thought I might be able to use this to save the block locations but it always returns 'accessed none' while trying to set the blocks location, rotaion and scale from the array. Im not sure if this is because the blocks are being spawned in rather than present at level load, if its because they can be destroyed, picked up and replaced down and thats messing with the ordering of the array, it all seems to work up to the point of respawning stuff in, I tried with a few blocks I had placed manually and it saved the change at first then when I destroyed some more in game and saved I'd load back in and they would still be there, so it remembered the first change but not the second, absolutely baffling me at the moment Any help would be appreciated, although its an older video at this stage so idk if you will see this lol
great vid, but i guess it doesn't work for my needs at all. :( i was trying to have this save the locations of items that i spawned / removed from the map. My current setup, the class im saving and loading is the base actor bp of all my interactable items, right now, all i can do with them in terms of the level bounds, is pick them up to my inventory, and drop them back on the ground, and equip them to my character. I have it saving nicely for storing my stats and what my inventory was, and what i had equiped and such. But following this guide, after saving, the items on the map i pickup are not saved as no longer on the map, and the items i drop, are not being added to the map when I load. did i miss something or am i seeking something totally different in blueprinting setup?
Hey, i don't know if you still need help with this, but i'm gonna give you my opinion anyways. So, the items that you picked up have a blueprint i would assume? Also, it's kinda vague what you are saying about ""after saving, the items on the map i pickup are not saved as no longer on the map" Do you mean that they are not saved in your inventory? (after pick up) Or that they are not saved in the level? (which is correct, since you already picked them up and they are in your inventory, unless your game idea functions otherwise) Also ""and the items i drop, are not being added to the map when I load. "" Now, assuming that these objects have a blueprint, that means when they are called from the "get all actors of class" the object that you dropped should also be called, does that not happen? If so, then try to make it so that when the "save game" is triggered, the saving process for this class type will be done inside of that class's blueprint. (Which means there has to be a way for that class to know that the "save game" is triggered, in order to perform the save.... same goes for loading) I hope this helped.
I've been trying to figure out something so i used your guide to save trees in my game (survival game) but when i destroy the trees and load the game it comes up with an error and i have no clue why.... i did make it in a user widget "W_PauseMenu" however i know it works because my health saves
Hello Totally Unreal, at first I wanted to say that this was a very great tutorial. I have learned much and I will be able to adapt this system to my own project. But for some reason it won't load or probably even save the rotation of the player. Could this be, because in my game the player is only able to walk left and right 90° or do you know any other reason? The second question is that in my endless runner game the player moves always further until he struggles at a certain point, hits something and dies. Therefore I'm spawning him a random generated array of tiles which get destroyed every 2 seconds when the player walked over it. I wanted to save the current tiles which are spawned, but when loading the tiles I get the error "Cannot access blueprint...It is pending kill..." I know that I cannot reach them anymore, because they got destroyed. is there a workaround ? I need to destroy the tiles so they dont probably block the path with the newly generated tiles. Do you know a way how to fix this? Thanks in advance.
Hi Totally Unreal, nice Tutorial. It worked for me but Im new at UE4 and i tried to save the game by passing a special trigger-box instead of pressing “G”. Could you give me a hint? If i do a Event ActorBeginOverlap it saved on every trigger-box in the whole game.
how can i save keys that unlocks doors? so when i pick up the key it gets saved in the array but how can i let the door be unlocked then? like key1 for door1 and key2 for door2 with only 1 key blueprint and 1 door blueprint
+KleytenHD I couldn't tell you without having a play with it myself and its not something I have time to dig into right now, sorry about that but I really think tags are your answer
I understand this is like 3~4 years ago, and i personally made a 3 category based saving&loading system similar to this. But i noticed that you seem to need to make an individual array class for both transformation and saving the ID of the specific class... which isn't really that practical when looking at a project with hundreds of blueprint objects. I understand that you made this specifically according to a request, i'm just saying this cuz someone may look at this video and has to make an array class type to store many blueprint classes. So anyone reading this, you can simply use an object array instead of a specific class array. Since you're looking to save "General Object Variables" like the transformation and "ishidden" and such, you don't need to have a specific class type. You can instead have ONE object array, that you'll put all the objects classes in it, and ONE transformation (and if you want, a ONE boolean array for the "ishidden" variable). Though, you have to be careful as to get and set all the variables accordingly IN ORDER just like how you stored them in the object array. This is so much more practical than having an individual class and transformation array for each blueprint.
Hi. I don't suppose you have an example of how this would look in a blueprint do you? Also, maybe you could help with an issue i'm having with this system. I'll try to explain as clearly as I can. 1) I have a small level. My player has an inventory. There are a number of pickups (actor blueprints) in the level. 2) Now I can save and load both my Inventory and Player Location with no issue. Now my issue is with saving and loading the various pickups around my level. Let's just say for now, they are all of the same class 'BP_Pickup' Now if I press Play, and without picking up anything, I save the game, and then pickup an item (which gets added to my inventory) and then try to load the game I just saved, I have an issue. What I was hoping would happen, is my character would return to the location he was at when I saved the game (which it does) and that the pickup I picked up would reappear where it was before I picked it up (which it doesn't) < This is the Issue. It is not in my Inventory (which is right because I saved when my inventory was empty) and not where it was originally (which is my issue). If I stop the game, I then get an error saying the Load Save Game function couldn't access the Pickup because it is pending kill. Lastly, if I delete my save and play again but this time pickup an item which gets added to my inventory and then save the game and after that press the load save game button, my character goes to the right location, my inventory still has my pickup in it and the item I picked up is gone. However, If I then stop the game and play again (which automatically loads my save) My Player Location and Inventory are how they should be with the item i picked up earlier still in my inventory, however it has also reappeared on the ground again ready for pickup. How would I go about ensuring it doesn't respawn? Sorry for the long read, any help would be appreciated.
@@earthbornjim9975 Actually, i was planning on making a tutorial explaining the system that i have :b Though before doing so i'v been searching around for "saving&loading" tutorial videos, and i'm surprised to see most of them scratch just the very basics of it. I suppose there is an easier way for us to communicate with each other if you may need immediate help though.
@@wolfboos I wrote a bit more about my issue also, not sure if you can help. Any other way of communicating would be better than this :) Just let me know. This is the only real issue i'm having at the moment.
@@earthbornjim9975 Hey, i'm really sorry for the awful long time you had to wait before my reply... I'v had a really rough day. Last day of exams, and was awake since yesterday. Anyhow, i wonder if you can private message me here (if that's even possible in youtube) and send me your discord name to add you.
@@wolfboos Hey man no worries, I had to go to bed anyway. Was late in Aus here. I don't know how to PM here. But my discord name should be 'ILikeOnions'. I rarely use discord so I hope its right.
Thanks a lot. Been searching for a tutorial for this, for a while. I second to that jamie mulvaney guy down in the coments. It would be great if you have some advice for implementing this trought an UMG.
yo dude this does not work anymore for 4.17.1 ..... like I don't get any errors,but it only sets my character in the place it is supposed to be. the actors don't get moved at all... please help :/
Yes I have actually reworked and customized the code to fit with 4.17 actually you can do a more encompassing save of objects with a little bit of tinkering with the loop... in general its all good I got the stuff fixed :)
Well instead of using specific actor reference (for the thing you want to save) I did it with just a general actor array,and then I tagged ones that I wanted to save. So I got (all actors with class) and -> (actor array) so when I load it does not seem to have problems after that...
I was having an issue where my arrays were adding more each time I saved instead of just getting what was in the world. fixed it by clearing each array (drag off of get array and type "clear") before getting the actors of class. That... seems to have fixed it..? I'm using a game instance to save rather than the player controller BP. Just posting this in case anyone runs into the same issue with a slightly different setup like mine. xx Thanks for the tutorial its gotten me much further through my bastard save system.
Didn't know how to use arrays before but......now i do. I got a building system going so this is perfect. Edit: This does not work for me at all. Messed around endlessly. I worked out that this system moves placed objects around. If i hit play and spawn objects in with a building option i have, you will have to set up code to spawn the objects at your transform location on load.
Hey, You should upload photos of your work, for easy referencing and viewing. Just watched the guide and it's useful for building my knowledge. Tank You. *The only issue I am having is "Get Control Rotation". (Error This blueprint (self) is not a Controller, therefore ' Target ' must have a connection.)
Great tutorial. It helped me get my save system in place really well. I ended up modifying it quite a lot, and I'm thinking about making an extension tutorial so its a bit more dynamic. Currently with this system it is only capable of holding a single level worth of physics objects. The moment you move to another level (even with the info saved and reloaded from a game instance) the arrays might not match up. Because for example, say you have 3 cubes in each room, you'll have one set of cube arrays in the first room indexed at 0,1,2. Then the next room they will index at 3,4,5, and a third room at 6,7,8 etc. Go back one room, and it will attempt to match up the current rooms cubes (the get all objects array will only find 3 cubes) which index now at 0,1,2, but are supposed to be matched up with the saved index of 3,4,5. ALSO... every time you save, its adding another element to the array for every cube in the room. This will inevitably lead to a bloated unwieldy array that is then useless and using up memory unnecessarily. So in my system, I've solved that problem. Let me know if you'd like to see it, and also I'd like your blessing to heavily reference this video.
This is the exact problem I'm currently facing and not being that proficient with how arrays work, I am struggling to wrap my head around it. I know your comment is a bit old, but I'm actually trying to figure out myself how to carry these values over from one level to another. So if you could explain that I would be incredibly thankful!!!
1. Suppose I save a game and one of the saved classes is say an enemy. I shoot the enemy, I kill it and for performance purposes delete the Actor. What should I do on load? Validate ad each loop body does the object exist, if it does - set it, if it doesn't - pass to the next one? 2. Suppose The game has spawning enemies or objects, which appear during gameplay, and don't exist on start. I save the game, then get out of the game and want to continue. I suppose the answer is spawn actor of class and then set its properties for each array object, but what if there are some objects placed as default and some spawned on the way :D ? 3. The BIG BADA BOOM - combine 1 and 2 :D So we have to check if the object was default or spawned, if default - set its variables - if spawned - create it - if destroyed - do nothing? :D Just some more complex but real ideas to consider :) Anyway great tutorial, thanks!
So sad for this tutorial. It have my actual problem. GetAllObjectOfClass doesn't get everytime the objects in the same order. This script work only if the objects are totally the same. useless.
You're probably the only unreal tutorial guy i can stand for more that 2 minutes, so congrats on that. Great job with the paint explanation too. Keep it up!
Got it to work in 4.18. On the Save part exclude the Cast to Save Game. on the Load Game section on "Load Game From Slot" add the cast to save game and then continue with the video as normal.
I was looking for this comment, thanks bud!
This modification also makes it work with 4.21.2
oh man, i tried everything, but i dont get it what you mean. I use 4.21, i read below it works then, but i cannot figure out why it doesnt! cannot get the "set SaveGameSubclass" in the load area
@@rctrickstipsfun6504 just ignore "set SaveGameSubclass". Add "cast to save game" first, and use it's output node to "set SaveGameSubclass"
@@wtfranticdreamer thanks man, i figured out just a short while ago. Forgot to mention that here. Thanks for the help💪🏻
perfect, this is exactly what i was looking for! thanks!
That explanation was perfect!! The one you said you wanted people to leave a comment about. Nice job on this, man. It's really helped on a game I'm trying to make which switched between different levels very frequently.
I liked the paint diagram! Fantastic tutorial. Not everyone can explain things quite as well as you do in this tutorial. This was exactly what I needed.
For anyone looking at this tutorial now, a more modular way of doing this is to create a blueprint interface, and instead of saving with "Get all actors of class", use a "Get all actors with interface" node and add the interface to any actor you want to save.
is that any more beneficial than using Tags? (get all actor with tag) it seems like they are all equally slow processes? or i guess it depends on if you have lots of tags but few interface nodes ?
Yep great tutorial. Nice rhythm and tone to your voice (very important when you have to listen to somebody for a long time.) Made lots of sense. Keep it up. Hope you recovered from your injury / op as well !
This is the best tutorial I have seen in my entire life. I really appreciate you trying your best to explain things and you did do really well on that! I hope the blueprints are mostly the same 4 years later but either way thank you for this amazing video!
This video is amazing! It helped me understand new concepts, explained things in a way I could understand without seeming like it talked down to me, and moved along at a swift pace. I wish I could like a video more than once!
A huge time saver, goes great with another TH-camr UE4 project, keep up the great work
Thank you! ----- You made it so easy for me and you nailed the explaining! it was so easy to understand what you talked about! ;)
There was an issue i had when i did this loading the game from a MainMenu level.
It turns out that the call to the function "Load Game from Save" validates the object references and breaks them if it cant find them, which means if you do not actually have the Level loaded up when you call that function, the list will be broken.
For example I called that function from main menu, stored the array in a variable on Game Instance, then loaded the level, and then tried to read the array from the version in GameInstance, and the array was broken (number of entries was correct but each object reference was broken). So Instead I had to load the actual game world Level first, and THEN call the function from game instance to load the game, and then the object references worked.
Great Tutorial!!! After trying several other Save/load tutorials only this one worked for me (ue 4.26.1)
Finally a good to the point tutorial. Thanks a lot. Really helps out us beginners!
OH MY GOD! THIS is se BEST Turorial for Saving the own game. Thank u very much for this perfect Tutorial!!!!!!!!!!! :D
You can do an array of Structs, so you can do both location and class reference in a single struct, and then save an array of those structs
Great video! Something must have changed in 4.18. When I try and connect the "Load Game From Slot" return value to Set "SaveGameSubClass" I get an error about Save Game Reference is not compatible. I have tried your video and another video and get the same error at the same place.
Thanks for the tutorial!
But what about the objects that were spawned?
Any thoughts about that?
i believe you would basically make an array of the class types as a reference, then on Load, for each item in the array you SpawnActor (spawn / instantiate) using that class reference, and then apply the rest of the variables to it.
it can be useful to use structs instead of multiple separate arrays ( so instead have a single array of a struct that has the location/class reference/other variables/etc, and build to/from that struct array)
This makes every save game blueprint make way more sense. Thank you haha
At 6:00 , couldn't you create an array of Structures containing the classes and transforms?
Doesn't work for UE 5. Unable to do the steps at 18:11.
Thank you very much this was one of the greatest problems I had in my unreal project!
So good. Thanks. Really hoped to find solution for this problem. Perfect.
Cool, I was working on some modular build project and was frustrating to place some actor and wen u come back on the game to not be any one there, now I get the point, and I understand how to make it. I mean I like because is not copy-paste like 'make this, connect that to there etc.' I can understand why I connect that to there :)
Man, I need help!!!!. How do you make it work on a build system? I'm trying but it only works for objects that were already in the landscape. When I try to load objects that I put after start playing, it does nothing, just load the player position and all that stuff.
This is great - but do you have a check for whether the actor still exists or is destroyed? Would you do a boolean array? or have an is valid check somewhere in here?
THANK YOU SIR!!! I got a bonus out of this! I had yet to figure out how to change the controller rotation, and now I can! Lmao thanks again!
(P.S.: This works in the latest version, 4.24.3, as far as I can tell! Yippee!)
Was anyone able to add additional actors to save? When you change actor class to anything else you get an error?
Good video~
I would say for anyone looking into this recently to try creating a Structure that contains a variable for class and for transform. Then maybe the process would run a little smoother maybe if it came to even larger maps. Ever since I understood structures, I think I fell in love with them lol.
I am curious how well it would work across multiple maps since I would be uneasy to save their transform just by leaving a map. So maybe a temporary array / save file when leaving a map could be used to feed the final save file the updated info without having the chance to incorrectly save progress?
It all depends on the design of the game, of course. I am trying for a farming/adventure game, currently. So that's why I wouldn't want to save it simply upon changing maps vs when the player decides to save the game. I think the loading part could check whether the temporary array has a length of one or more to decide whether to load from master save or temp save.
Hopefully, what I said helps the thinking/building process for others. It helps me to type things to figure out some stuff.
Thank you very much for this tutorial, it helped a lot. (hope you have fully recovered from your operation by now :) )
Is there some way to accomplish this using associative arrays with blueprints in order to store more complex data?
Great tutorial, explained everything perfectly!
Just watching back some old videos, i reckon we could make this more efficient by having the object store its transform and just saving the object.... Just a thought ^.^
I was 6 min into the video and I thought I would ask the question x) Thank you for predicting that ;)
the object already stores its transform ?
Nice video, will this save spawned items also, like in a sandbox game environment, or does all the objects have to be in the level to start with?
Question, you are storing an array of transforms, and also an array of the instance that contains the same transform. Whould it be the same to not store the first array? and then when you want to load your level, you just perform a foreach stored instance, getActorTransform?
Awsome tutorial! Its an old video, but I realy hope someone can tell me why this is not working if the objects is teleported (not pushed arround) to a new location.. I set up a teleport by giving the actor a new location on overlap, but the new location isent saved.
I was also wondering if you could possibly help in setting this system up through a UMG save and load button? That would help tremendously. Great tutorial though! Thanks a lot!
much much use this provides, thanks man youre awesome
Why do you have to build and break the transform instead of using getTransform and setTransform? I'm asking because I was like "oh thats dumb Ill just use this" and it didn't work so now I'm curious why these even exist
13:09 like the part were that doesn't work, like it literally doesn't let me
hey man i love your stuff! Somehow though it doesnt work for 4.21. I cannot set the SaveGameSubclass as a return value of the "load game from slot". In your video its 18:25. Whatever i try i dont get it running. It will save,.. i think :) But wont load! Have you any idea whats going wrong here?
I have the same issue :( did you ever figure it out?
@@TritumOfficial ha yes i have, but its a while ago. I think the cast to character must be in front of that subclasnode, and then it works
RC TricksTipsFun thanks I'll give it a go next time I get the chance :)
I have an inventory system that i made in my game and i cant figure out how to save it for the life of me. Its slot based and I have no idea how to save the items that have been stored in the inventory. I can save the fact that theyve been removed from my inventory but not the fact that theyre in the storage. theyre basically just deleted
Hi, good tutorial, and the MS Paint drawing made sense. :P Can you upload an image of the completed blueprint for quick offline reference? Thanks!
Any chance you'd make an updated version of this? I could really use your help. Thanks.
thank you, this works great for my rts game, but for some reason when I try to set the building hp from the array, my buildings end up damaged, I set it up so it grabs the class instead of the object and set a variable on the buildings for their hp, so when you call to spawn a building you can also set its hp directly, unfortunately its getting weird values >.
All other tutorials on this topic are terrible. This one's perfect :^)
Hey do you have any idea about how to do something similar to find out whether or not an actor is destroyed so that it wont be spawned at all after loading? I can set a boolean on event destroyed but since the actor is then destroyed when doing the "get all actors of class - for each loop" it wont add anything to the arrays because the engine wont find any actors of that class.
is there a reason you use "make transform" instead of getting the players transform?
@@JaredKellen no, getting the players transform will work too!
Hey iv been wondering is it possible to load the characters saved position after opening a level iv been trying this and it knows the last saved location but doesnt move the character to that location
I'm trying to replicate this for allmost 3 days but it does not work in 4.9.2. There is some strange issue with ForEachLoop macro and it spoils whole setup. I can save pawn's transform but not the array's, keeps telling that 1) The Array is not compatible with Reference, 2) Later it begun to tell the ForEachLoop Array Target is undetermined... Is there a workaround?
EDIT: OK I made this working but it only works with StaticMeshActor, it refuses to work for any kind of BP object I create like in the beginning of the tutorial.
hey, i think i know which your problem was.
At the moment when you have to state, the two array variables for class, in the details panel, in the right side of the variable type scroll menu, there is a little symbol, that is made of 9 little squares, you have to click it to convert it to an array of that kind of variable. Then all will work.
I just have one issue whit that, it happens that, even when you reset the Location,Rotation, and Scale. The load process don't stop the Momentum of any previous Physical force applied to the object
Thanks for the tip, anyway I think I will still need to use some higher inheritance level just to get everything possible into the array that can move in the level. Regarding your setup for class "class 1" you get only 1 class of objects out of all possible moving objects in the level, this script takes in matter only "class 1" objects. Thus there are two options, first build the script for all possible classes (no way) or use higher inheritance level which I believe is a way to go.
I'm trying to move my understanding a bit further and as 80% of things were clouded 2 months ago, now it's much much better, thank you a lot for your script it really helped me to learn more about the engine. I composed your script directly into overlap saving script for my game thus when checkpoint happens, everything gets saved.
I already check a lot of times.. .but here is justing saving the player position.. How Can I save intenger´s ?
Hey wondering if you could offer some advice on setting this up using buttons from the UMG say a save button and a load button
+Jamie Mulvaney I'm also looking for help with this. I followed these steps, but I'm trying to only allow the character to save while sleeping and load button is in a main menu widget so when I try to reference the save game sub class I'm unable to set a proper target.
+Behron Georgantas so is it what u are looking for
+Jamie Mulvaney I'm trying to make a button that on clicked saves everything in the game. then I want to click another button in a different widget to load it all again.
+Jamie Mulvaney I'm trying to make a button that on clicked saves everything in the game. then I want to click another button in a different widget to load it all again.
+Behron Georgantas So I have an example showing you how to save and load from a menu's using buttons etc should be everything you need ! here is the link to download its a full project so you can see everything 1drv.ms/1W49d5o, one thing can you visit my youtube channel and thumbs up some of my development videos I have made documenting the development of my game would really help me out when the review comes
How can you actually save High Score that's connected to Game instance with Game Save object. I got the game instance working but dont know how to save . I have saving set up as well but integer + integer increment doesn't work with game save. If I incremented by 1 it always shows 1 on each trigger over lap.
Question: Couldn´t you just use "Get Actor Transform" instead of making a transform with the 3 elements?
And setactortransform on the load. Would really simplify
I wish I could give more than one like. I did eliminate the "cast to TheSaveGame" 4 nodes after the G key node since it wasn't necessary.
new versions of unreal automatically casts the save game after you run "Create Save Game Object"... so for this example it was necesary, it seems also at that time it doesn't have a "Set Actor Transform" and he did a lot of work to set the transform
Hmmm, it doesnt seem to work for my game, Ive got the ability for the player to put down blocks and machines MineCraft Style and I thought I might be able to use this to save the block locations but it always returns 'accessed none' while trying to set the blocks location, rotaion and scale from the array. Im not sure if this is because the blocks are being spawned in rather than present at level load, if its because they can be destroyed, picked up and replaced down and thats messing with the ordering of the array, it all seems to work up to the point of respawning stuff in, I tried with a few blocks I had placed manually and it saved the change at first then when I destroyed some more in game and saved I'd load back in and they would still be there, so it remembered the first change but not the second, absolutely baffling me at the moment
Any help would be appreciated, although its an older video at this stage so idk if you will see this lol
great vid, but i guess it doesn't work for my needs at all. :(
i was trying to have this save the locations of items that i spawned / removed from the map.
My current setup, the class im saving and loading is the base actor bp of all my interactable items, right now, all i can do with them in terms of the level bounds, is pick them up to my inventory, and drop them back on the ground, and equip them to my character.
I have it saving nicely for storing my stats and what my inventory was, and what i had equiped and such.
But following this guide, after saving, the items on the map i pickup are not saved as no longer on the map, and the items i drop, are not being added to the map when I load.
did i miss something or am i seeking something totally different in blueprinting setup?
Hey, i don't know if you still need help with this, but i'm gonna give you my opinion anyways.
So, the items that you picked up have a blueprint i would assume?
Also, it's kinda vague what you are saying about ""after saving, the items on the map i pickup are not saved as no longer on the map"
Do you mean that they are not saved in your inventory? (after pick up)
Or that they are not saved in the level? (which is correct, since you already picked them up and they are in your inventory, unless your game idea functions otherwise)
Also ""and the items i drop, are not being added to the map when I load.
""
Now, assuming that these objects have a blueprint, that means when they are called from the "get all actors of class" the object that you dropped should also be called, does that not happen?
If so, then try to make it so that when the "save game" is triggered, the saving process for this class type will be done inside of that class's blueprint. (Which means there has to be a way for that class to know that the "save game" is triggered, in order to perform the save.... same goes for loading)
I hope this helped.
Is there a way to have multiple save files and be able to access and load them by having a load menu?
Yes, easily. Just make more save games with new names. Either name them automatically or have the player enter a save game name in the UI.
IT TELEPORTS ME TO THE SAVE LOCATION BUT THEN BACK TO WHERE I WAS BEFORE PRESING K
but how to make em deleted?
I've been trying to figure out something so i used your guide to save trees in my game (survival game) but when i destroy the trees and load the game it comes up with an error and i have no clue why.... i did make it in a user widget "W_PauseMenu" however i know it works because my health saves
Great tutorial. Easy to understand :D
It didn't work: my class1 stay in the same position when I load the save, ue vetion: 4.26
Hello Totally Unreal,
at first I wanted to say that this was a very great tutorial. I have learned much and I will be able to adapt this system to my own project. But for some reason it won't load or probably even save the rotation of the player. Could this be, because in my game the player is only able to walk left and right 90° or do you know any other reason? The second question is that in my endless runner game the player moves always further until he struggles at a certain point, hits something and dies. Therefore I'm spawning him a random generated array of tiles which get destroyed every 2 seconds when the player walked over it. I wanted to save the current tiles which are spawned, but when loading the tiles I get the error "Cannot access blueprint...It is pending kill..." I know that I cannot reach them anymore, because they got destroyed. is there a workaround ? I need to destroy the tiles so they dont probably block the path with the newly generated tiles. Do you know a way how to fix this? Thanks in advance.
Thank you so much! I'm using this to make an in game level editor
Hi Totally Unreal, nice Tutorial.
It worked for me but Im new at UE4 and i tried to save the game by passing a special trigger-box instead of pressing “G”. Could you give me a hint? If i do a Event ActorBeginOverlap it saved on every trigger-box in the whole game.
how can i save keys that unlocks doors? so when i pick up the key it gets saved in the array but how can i let the door be unlocked then? like key1 for door1 and key2 for door2 with only 1 key blueprint and 1 door blueprint
tags
tags? how can i do that with tags?
+KleytenHD I'm not 100% certain however I know that you can do it with tags. have a Google about how tags work in ue4 :)
i know how they work but how can i get the tags from like 25keys and check wich one is for wich door?
+KleytenHD I couldn't tell you without having a play with it myself and its not something I have time to dig into right now, sorry about that but I really think tags are your answer
i want to save table, but not work. I followed all steps
Awesome tutorial ! Thank you :)
how to save player position between levels?
Thank you so much !!!!! I was getting pissed .....until I found your video thanks again
I used the get all actors with tag node and it works perfectly
Good work! =)
I understand this is like 3~4 years ago, and i personally made a 3 category based saving&loading system similar to this.
But i noticed that you seem to need to make an individual array class for both transformation and saving the ID of the specific class... which isn't really that practical when looking at a project with hundreds of blueprint objects.
I understand that you made this specifically according to a request, i'm just saying this cuz someone may look at this video and has to make an array class type to store many blueprint classes.
So anyone reading this, you can simply use an object array instead of a specific class array.
Since you're looking to save "General Object Variables" like the transformation and "ishidden" and such, you don't need to have a specific class type.
You can instead have ONE object array, that you'll put all the objects classes in it, and ONE transformation (and if you want, a ONE boolean array for the "ishidden" variable).
Though, you have to be careful as to get and set all the variables accordingly IN ORDER just like how you stored them in the object array.
This is so much more practical than having an individual class and transformation array for each blueprint.
Hi. I don't suppose you have an example of how this would look in a blueprint do you? Also, maybe you could help with an issue i'm having with this system. I'll try to explain as clearly as I can.
1) I have a small level. My player has an inventory. There are a number of pickups (actor blueprints) in the level.
2) Now I can save and load both my Inventory and Player Location with no issue.
Now my issue is with saving and loading the various pickups around my level. Let's just say for now, they are all of the same class 'BP_Pickup'
Now if I press Play, and without picking up anything, I save the game, and then pickup an item (which gets added to my inventory) and then try to load the game I just saved, I have an issue. What I was hoping would happen, is my character would return to the location he was at when I saved the game (which it does) and that the pickup I picked up would reappear where it was before I picked it up (which it doesn't) < This is the Issue. It is not in my Inventory (which is right because I saved when my inventory was empty) and not where it was originally (which is my issue). If I stop the game, I then get an error saying the Load Save Game function couldn't access the Pickup because it is pending kill.
Lastly, if I delete my save and play again but this time pickup an item which gets added to my inventory and then save the game and after that press the load save game button, my character goes to the right location, my inventory still has my pickup in it and the item I picked up is gone. However, If I then stop the game and play again (which automatically loads my save) My Player Location and Inventory are how they should be with the item i picked up earlier still in my inventory, however it has also reappeared on the ground again ready for pickup. How would I go about ensuring it doesn't respawn?
Sorry for the long read, any help would be appreciated.
@@earthbornjim9975
Actually, i was planning on making a tutorial explaining the system that i have :b
Though before doing so i'v been searching around for "saving&loading" tutorial videos, and i'm surprised to see most of them scratch just the very basics of it.
I suppose there is an easier way for us to communicate with each other if you may need immediate help though.
@@wolfboos I wrote a bit more about my issue also, not sure if you can help. Any other way of communicating would be better than this :) Just let me know. This is the only real issue i'm having at the moment.
@@earthbornjim9975 Hey, i'm really sorry for the awful long time you had to wait before my reply...
I'v had a really rough day.
Last day of exams, and was awake since yesterday.
Anyhow, i wonder if you can private message me here (if that's even possible in youtube) and send me your discord name to add you.
@@wolfboos Hey man no worries, I had to go to bed anyway. Was late in Aus here. I don't know how to PM here. But my discord name should be 'ILikeOnions'. I rarely use discord so I hope its right.
Thanks a lot. Been searching for a tutorial for this, for a while.
I second to that jamie mulvaney guy down in the coments.
It would be great if you have some advice for implementing this trought an UMG.
yo dude this does not work anymore for 4.17.1 ..... like I don't get any errors,but it only sets my character in the place it is supposed to be. the actors don't get moved at all... please help :/
Bamboozled Aleks if it works for the character then it will for the other things. Follow the tutorial again closely and pause if you need to.
Yes I have actually reworked and customized the code to fit with 4.17 actually you can do a more encompassing save of objects with a little bit of tinkering with the loop... in general its all good I got the stuff fixed :)
I am having the exact same issue can you explain what you did bamboozled aleks?
Well instead of using specific actor reference (for the thing you want to save) I did it with just a general actor array,and then I tagged ones that I wanted to save. So I got (all actors with class) and -> (actor array) so when I load it does not seem to have problems after that...
Hey, could you post a picture or video of how you did that, it would be very helpful.
can you update the turorial to 4.18?
I was having an issue where my arrays were adding more each time I saved instead of just getting what was in the world. fixed it by clearing each array (drag off of get array and type "clear") before getting the actors of class. That... seems to have fixed it..? I'm using a game instance to save rather than the player controller BP. Just posting this in case anyone runs into the same issue with a slightly different setup like mine. xx
Thanks for the tutorial its gotten me much further through my bastard save system.
Perfect Tutorial!!!!
Dude thanks so much this finally worked xD cheers
Didn't know how to use arrays before but......now i do. I got a building system going so this is perfect.
Edit: This does not work for me at all. Messed around endlessly. I worked out that this system moves placed objects around. If i hit play and spawn objects in with a building option i have, you will have to set up code to spawn the objects at your transform location on load.
Is this guy still around? Wanna ask a question
allan Roodt ask away
thanks, good video!
Hey, You should upload photos of your work, for easy referencing and viewing. Just watched the guide and it's useful for building my knowledge. Tank You.
*The only issue I am having is "Get Control Rotation". (Error This blueprint (self) is not a Controller, therefore ' Target ' must have a connection.)
Thank you . helps a lot
Great tutorial. It helped me get my save system in place really well. I ended up modifying it quite a lot, and I'm thinking about making an extension tutorial so its a bit more dynamic. Currently with this system it is only capable of holding a single level worth of physics objects. The moment you move to another level (even with the info saved and reloaded from a game instance) the arrays might not match up. Because for example, say you have 3 cubes in each room, you'll have one set of cube arrays in the first room indexed at 0,1,2. Then the next room they will index at 3,4,5, and a third room at 6,7,8 etc. Go back one room, and it will attempt to match up the current rooms cubes (the get all objects array will only find 3 cubes) which index now at 0,1,2, but are supposed to be matched up with the saved index of 3,4,5. ALSO... every time you save, its adding another element to the array for every cube in the room. This will inevitably lead to a bloated unwieldy array that is then useless and using up memory unnecessarily. So in my system, I've solved that problem. Let me know if you'd like to see it, and also I'd like your blessing to heavily reference this video.
This is the exact problem I'm currently facing and not being that proficient with how arrays work, I am struggling to wrap my head around it. I know your comment is a bit old, but I'm actually trying to figure out myself how to carry these values over from one level to another. So if you could explain that I would be incredibly thankful!!!
thx, really helpfull.
1. Suppose I save a game and one of the saved classes is say an enemy. I shoot the enemy, I kill it and for performance purposes delete the Actor. What should I do on load? Validate ad each loop body does the object exist, if it does - set it, if it doesn't - pass to the next one?
2. Suppose The game has spawning enemies or objects, which appear during gameplay, and don't exist on start. I save the game, then get out of the game and want to continue. I suppose the answer is spawn actor of class and then set its properties for each array object, but what if there are some objects placed as default and some spawned on the way :D ?
3. The BIG BADA BOOM - combine 1 and 2 :D So we have to check if the object was default or spawned, if default - set its variables - if spawned - create it - if destroyed - do nothing? :D
Just some more complex but real ideas to consider :) Anyway great tutorial, thanks!
Thank you!!
6:29 So glad im not the only guy with hot chicks on his desktop XD
Не работает больше
thanks
lmao anyone noticed "save the fu*king game" comment at the start?
1:50 vur bana dedi :D AQW:EDQAWED
So sad for this tutorial. It have my actual problem. GetAllObjectOfClass doesn't get everytime the objects in the same order. This script work only if the objects are totally the same. useless.
I was following this tutorial as seriously as I could and then Taylor Swift randomly appeared in the screen.
I died at " save the fucking game " :D ROFL GJ m8
lol save the fucking game haha
Awful drawing skills... but awfully helpful too :P
Thank you !!!