As the title says I am unable to spawn an actor from a save game. I have this exact process working for the primary weapon and after copying, creating/replacing the necessary variables I just cannot get it to spawn.
Does it work when you check for an existing SaveGame before you create a new one? See this (Press 1 for CreateSaveGame, Press 2 for LoadSaveGame): SaveGame.zip (854.1 KB)
This is the only check that I can see within the BP you provided. Not sure why I would need a check on a Cast fail when I know that the savegame is created. I can see the Secondary Weapon Savefile in the desktop content browser. It is as if Unreal just wont load it but checks that it is viable and everything.
Thanks for the help. I did and it came back empty.
(I believe I showed this in the third photo so you can see where in the squence. The yellow highlight)
Does that mean that the save file is being created but nothing s stored in it? If so, how can I check is something is within the savefile without actually calling it?
Yes the save file gets created correctly with an empty variable. I don’t know if you can check if the savegame has any values.
When do you use this savegame? Is there always a primary and a secondary waepon set for the player? Or could it be possible for the player to only have one of the two? If the player has always 2 weapons, then you should check if both values get set inside the player correctly. If it is possible to only have one weapon, then you would need an empty value and check => secondary empty? then don’t spawn one (just an example).
Not sure that’s possible as some of the material is from the Marketplace but I can look into taking it apart. In the meantime how would you debug it? I am going to look into validating the savegame within the sequence.
He made a good offer. So what he needs from you is easy to do:
Make copies (not move) of your main assets, and copy them to a new folder called Public.
Then right click Public folder, and migrate it to a new (empty project - you might need to make one before you do this step).
Then open Empty project > change paid textures to Default textures. And change anything else.
Put all your actors in 1 folder if not that many (or just the main ones in your main folder). Makes it easier for someone else to click and learn what is what. You can put textures ect in their own folder.
Then in Windows, go to where this project is saved, and zip up all those files. Then upload it somewhere to link for him. Or dm him.
Found the issue. I hadnt understood that Savegame files cane be createad without any data and therefre though that the Savegame function was firing when it wasnt. Turns out I had a bad cast because I set the Game Instance as a variable which became invalid due to a branch.
Good luck if you are using Epics Savegame thingy. It was buggy and incomplete for me. Theres a youtuber who made a Save game manager (plugin) that lets you easily check mark which Actors and variables for the Save game Man to save for you.
But it was for an older version I dont have. And I asked, but no one recompiled it for UE4.27 (open it and save it).
Epic’s way is too tedious, required me to make copies of every variable I wanted saved > to put in the Save Game asset vessel.