Saving Information on a Save Game

Hey there!

After this question How (and where) do I get a Unique Device ID, for Oculus Quest 2 Project? I was able to create a number generator that works for my needs.

The struggle now is to have this information stored in a save game, so that everytime a device starts the app, it generates that random number, stores it in a save game, and everytime the device opens the app again, it loads that same save game and gathers the information necessary, in this case that number that was generated, that will work as a device ID for me.

I tried setting a up a save game configuration, it creates and loads the save game, but it never stores information anywhere, so if anyone can light up the path to have a working save game on the oculus quest 2, that stores that generated number basically as long as the device can load that particular save game… I would be really appreciated.

Thank you!!

Procedure is like this:

1 - check if savegame exists
1a - exists? Load it
1b - doesnt exists? create it —> AND SAVE IT <----

let me show you the proccess:

then I use in the game like this:

and/or

in the last one I modified the contents of the savegame I have loaded and SAVE IT

Hope it helps! :slight_smile:

2 Likes

Hey there!
Thanks for your time and reply! Really, really useful!

I still have some questions, just to clarify and try and understand a bit more:
1- You have this set up as a fucntion, in your game mode blueprint?

2- Also, In that last part, where you modify the contents of the savegame,

So, i need to call the “Mi game mdoe” function, have it as a target the mi save game and this htp variable is the information i am storing in the save game?

in my case i need to save a string (10 numbers and letters) on a string variable. Do i need to set the string variable as an array and replicate your setup in the image?

Thank you!

Hi! you don’t have to put this in a function but is a good practice to do so.
I store my current savegame in a variable in my custom gamemode but you can store anywhere you want to. even you don’t need to store. you can load/modify/save like this:

storing in a variable saves me the load and cast every time I need my savegame.

here is another example:

you can save Strings, Arrays, any variable type. No need to use arrays only. It depends on your savegame model design

3 Likes

Hey there! Thank you so much for your time, super useful and detailed!

Cheers mate!

1 Like

Glad to help!

1 Like