Duplicate map when saving data (UEDPIE)

Hello guys I’m making a saving system and it needs to save a couple of things

  1. An integer that increases when the player picks up and altar
  2. The state of the altar(Has it being picked up; yes or no ? ) since there’s multiple of them per level and the players should not be able to pick it up if it has been already
  3. The current name of the level to start from there ( I’m using level streaming, load and unload)
  4. A widget that has the images picked up from the altar
  5. The Transform of the player.

The save data gets store on the Game Instance

Here’s an image of the struct

Now my money on what causing the issue it’s probably the altar BP since the engine has crashed multiple times while having the level open and compiling this class, but I don’t discard that it might be something else.

Because I’m using level streaming, I cannot do a get all actors of class when I start the save. I need to do it on every instance of the altar on Begin play since this one gets called when the level is loaded

It looks something like this

This is for adding to the map as I said, then if you load from a save slot you should trigger the event destroy

Ok and finally when I’m playing and changing levels I get this

I think your problem is something to do with using references in your struct.

A reference is something that only exists during play when the map is loaded. Once the map has closed the reference means nothing.

I recommend giving each of your altars an ID, just an int that’s visible in the editor. You need to number each altar so the IDs are unique between the levels. In the game instance you just need an array of bools. Each alter knows which bool belongs to it, because it’s ID is the array index.

When an altar is picked up, it marks the slot in the bool array itself. When you re-enter a level, the altar knows it has been picked up and can destroy itself.

Same problem with the widget references ( is that what they are? ).

Yeah in the end I did an index for the elements that should be visible in the widget and I replace the references with a map int/ bool and the problem went away. :slight_smile:

Please i need help with this problem. I don’t understand how to fix it (UEDPIE). Please, write some example for me. Thank you.

JG

If I interact with this, is problem with UEPIE