Saving destroyed objects over multiple levels

Hi All,

I’m having an issue with saving destroyed objects across different levels, now i followed all the information from this question: https://answers.unrealengine.com/questions/259937/save-actors-destroyedpicked-state-between-levels.html
But the problem I’ve been having is that it works completely fine if you only have 1 level, but the moment I’m working with 2 levels in stops working. Unless each level has a separate save file, which of course is not helpful.

So does some one have a save system which can save destroyed objects, that works across multiple levels. Because I’m literally at my wits end trying to get this function to work.

Can anyone help me with this? I’m really struggling. Or if some one has a demo level with this function so they could show me??

I have the same problem but nobody answer

I’m going to tentatively add this as an answer, having never attempted this myself, but are you aware that the GameInstance persists across levels?

My suggestion, having briefly looked at the answers linked in your question, is for the game instance to keep track of the state of items in each level it visits. That way, it could inform the level upon loading which items have been “destroyed”.
This information could either be stored in arrays/variables, if you’re not too concerned about memory usage, or you could save and load the information from files.

Also, take a look at this, if you haven’t already: https://wiki.unrealengine.com/Game_Instance,_Custom_Game_Instance_For_Inter-Level_Persistent_Data_Storage
It is in C++, but you might be able to glean something useful!

Sorry, I can’t be of much more help right now, but I just wanted to offer a potential lead. If I find you’re still struggling when I get back to my PC, then I might be inclined to dabble with it myself =P

Thank you for your answer!
But i don’t know how to use C++ need to start to learn next year ;—;
You have maybe one exsample about that?
Here is my project Dragon Step
https://www.youtube.com/channel/UCG8asYgVjHtfTmDdEPHKRPA?view_as=subscriber
I know how to use UE4 but i never done that before ;----;
I know how to save my character transform position and rotatio,Stamina,Healt,Diamonds Pickup…
But i don’t know how to save Vase
So in my game i have Vase Actor with destructible mesh…so… when my character destroy the mesh he get 1 diamonds.
But i want to save the vase i have destroyed.

Thank you i really need this!
I hope someone can show me an exsample.

I know how to save a float and player position But i never done something like that.
Thank you!

Here is my Blue print

Here is my Blue print

Sorry, I’ve been busy. Did you get anywhere with this?
If not, I’m happy to attempt it myself and provide a demo of sorts if it works!

Don’t worry!
I try but was not working ;—; If you can make that for me you will help me so much!
You will made my day!

As I know, you can’t save destroyed objects, because they are destroyed and are forgotten for many reasons - optimization for example. In best result you have error message about referencing to object begin destroyed or even game crash.

If you are talking about Objects, you mean Objects or Actors? Because this is big difference.

[A] If Objects, you should store it in array (for example) before destroy event. This array should be “attached” to actor moving through levels or better to game instance.

If you have to save destroyed actors, only way I know, is on destroy (before…) create Object, move all variables from Actor to Object (including location if you need etc.), then back to point [A].

This is way how my inventory working for example and not only. This working well on my side.

Hey, Generaleivan1996, sorry, but I never saw this reply until today!
I’m not sure if you’ve found a solution or not, but I’ve been looking into it myself and I’ve made something that works, though it does need to be made a little more sophisticated, but I’ll cover that later.

[This][1] is one of the main sources I used.

So, I created a base actor from which items which will be saved and loaded are derived (using “CreateChildBlueprintClass”) and did this in the event graph:

Then, make a LevelDatabase class. Every level should contain one instance of this class.
Here is its blueprint: Item Database Class posted by GreyWacke | blueprintUE | PasteBin For Unreal Engine 4

So, what happens is the Database finds all instances of the item class in the level, and uses an array of bools, stored in a SaveGame to check the state of each item; disabling them where applicable.

When saving, the database refills the array with the new values of the items.

Now, this system DOES work, however it’s rather crude, in my opinion.

My suggestion would be to store this information in a single SaveGame instance, which would be loaded up and stored the the GameInstance. From there, the database (or even a level blueprint) could gain access to the information.
Perhaps a LevelData struct could be used to hold this information, and each level would have its own LevelData. This could even include information such as Gems remaining, high scores etc.
Then, when the level is loaded, it would ask the game instance for its own LevelData and perform the necessary actions.

I would like to give this a go myself at some point, though I’m so busy right now (hence my delayed response), but if you or anyone else still needs help, then I’m happy to pursue the idea or provide any additional help and/or clarification!