# Duplicate map when saving data (UEDPIE)

**URL:** <https://forums.unrealengine.com/t/duplicate-map-when-saving-data-uedpie/478472>\
**Category:** Editor Scripting\
**Tags:** savegame, Level-Streaming, duplicate, unreal-engine, question\
**Created:** [February 8, 2021, 9:43pm UTC](https://forums.unrealengine.com/t/duplicate-map-when-saving-data-uedpie/478472 "2021-02-08T21:43:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elfideo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Elfideo](https://forums.unrealengine.com/u/Elfideo)\
**Post date:** [February 8, 2021, 9:43pm UTC](https://forums.unrealengine.com/t/duplicate-map-when-saving-data-uedpie/478472/1 "2021-02-08T21:43:46Z")

</div>

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

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/d/4/9d41c80e4a8cf1afbd5aae41dc1bb883086f5028.png)

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

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/b/37bcb581664c2473f299675413175e246c845f02.png)

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

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/6/a5669ce478a29b6397f9c5dbec4ee590c1f994f9.png)

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

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/8/b/68b15655d2983f134e618ae96e2068cd041474e2.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 8, 2021, 9:55pm UTC](https://forums.unrealengine.com/t/duplicate-map-when-saving-data-uedpie/478472/2 "2021-02-08T21:55:53Z")

</div>

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? ).

---

<div class="post-metadata">

**Author:** ![Elfideo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Elfideo](https://forums.unrealengine.com/u/Elfideo)\
**Post date:** [February 10, 2021, 12:29am UTC](https://forums.unrealengine.com/t/duplicate-map-when-saving-data-uedpie/478472/3 "2021-02-10T00:29:32Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![Noneus17](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Noneus17](https://forums.unrealengine.com/u/Noneus17)\
**Post date:** [August 7, 2021, 11:03pm UTC](https://forums.unrealengine.com/t/duplicate-map-when-saving-data-uedpie/478472/4 "2021-08-07T23:03:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Noneus17](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Noneus17](https://forums.unrealengine.com/u/Noneus17)\
**Post date:** [August 7, 2021, 11:05pm UTC](https://forums.unrealengine.com/t/duplicate-map-when-saving-data-uedpie/478472/5 "2021-08-07T23:05:58Z")

</div>

![345854-bl.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/b/2/5b258609e77411fc4013b6d3d3777a2d96e7c368.png)

---

<div class="post-metadata">

**Author:** ![Noneus17](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Noneus17](https://forums.unrealengine.com/u/Noneus17)\
**Post date:** [August 7, 2021, 11:06pm UTC](https://forums.unrealengine.com/t/duplicate-map-when-saving-data-uedpie/478472/6 "2021-08-07T23:06:43Z")

</div>

If I interact with this, is problem with UEPIE
