I'm using this as a test for a save & load feature, although it's very simplistic but it's all I need for my game.
feel free to use this code for your own projects (no credit needed, may require adjustment)