Ok, so I’m still in the phase of tweaking and wrapping up my very first game.
It’s coming along nicely and I literally couldn’t have done without you guys.
Thanks again for all the help so far.
What I am trying to do next is a bit tricky and I have no clue where to start…
When a user starts the game I would like to do 1 of the following:
if there is an internet connection… request an id from a url (backend is in php)
the php script will generate a uniqueID and send it back to the game. (Save this id locally, somewhere/somehow so that every time the user starts the game that is already set)
generate a uniqueID (following a specific pattern) locally, inside the game (save that somewhere/somehow) and post that to the server.
I really need this uniqueID so that I can save the user’s data on the server.
As always, any tips, pointers, suggestions (workarounds?) are greatly appreciated. Would prefer this to be done through BPs but if its only possible through cpp I’m open to that as well.
Thank you!
I was able to make it work by connecting to the server… generating in php a unique token and getting that back to UE.
Now… how can I save this token as a global config variable locally, so on any subsequent game launches I can read it from that variable???
Is there a mode (higher level than the game instance) where I can set this variable kind of like a config variable??? That is persistent through quitting and restarting the game?
Any tips are greatly appreciated.
you can store Variables permanently and persistant in your Custom GameInstance. The GameInstance gets initialized on GameStart and stays alive, even during level loads… it only gets destroyed when quitting the game.
That’s the issue… I need to save a config variable that I can read every time the game starts.
When the game starts for the 1st time, I can connect to my web server, generate a unique token which I can pass back to the game. I would like to be able to save that token, so on any future game sessions I can access it.
In CPP we have a class called UDeveloperSettings which we can use to have our own custom .ini fields.
I am afraid I don’t know the alternative for this in blueprints but you can use simple file handling to read and write the token file or just use the existing save game system.