Map doesn't save a second time

I’ve made a level editor. Saving and loading the levels works well, however saving a level that has already been saved deletes it instead of storing it’s values again. I can save as much as I want until I load a different level, It doesn’t save after that. “SaveName” is the name of the text input you can see in corner in the GIF provided. And don’t mind the Levels array, it doesn’t help or interfere with the loading and saving.

The problem will lie with this trigger once command :

The first time you save, it gets fired once, resets current_id to 1, and so the stored object details are read in. However, the second time you save, this trigger once will not fire, as it has already done so once before. So current_id will remain at whatever value it was from the saving events.

I think removing the trigger once should fix your problem. As would moving that whole event to before the first event in the second screen shot.

I’ve found the issue. Whenever a tile is placed it’s “name” variable is set to the object’s name. When a map is loaded none of the objects have their “name” variable set, so it doesn’t get saved a second time. Thanks for the help though :sweat_smile: