What I want to save: an integer with their high score, that is it.
Problem: It works on pc, but not on android.
When ever I build to android all the messages say that it loaded the save file just fine, and it DOES load something because it will show me the score that was obtained on the computer, almost like it is loading off my computer and not the phone. (this happens on both simulator and real phone)… Also, going into the phones file directory and deleting the .sav file DOES NOT stop it from loading the high score made in the editor.
Anyhow, I have done everything I can. I even packed it as “Shipping” (I thought that this would strip it of the desktop save file) and zipped it, sent it to my Mac, then installed it on my phone AND it still loaded the high score that I had gotten on my desktop… not only that, it does NOT save any new high scores while playing on the android phone, although it SAYS that it saves (no errors on save)
Anyhow, I have tried a lot to figure this out as I’m sure I’m just doing something stupid… I have attached my load and save blueprints, all the extra crap in them is me experimenting!
Really? no one? someone please help! tonight I will be trying to do the exact same thing in c++ but I’m pretty sure it’s the same c++ functions… Has no one run into this problem?
It would be nice if someone would at least look at my blueprints and tell me I’m not doing something simple and stupid… there are only 2 small blue prints…
I don’t know how your phone takes save game from a pc, since the engine will only look for save game inside “/saved/saveGames/” folder on the device. Check default value of highscore. Click on highscore variable and see if its 0. If its not 0 you have your answer how your phone have your pc save game (:
thank you, I will test this out tonight when I get home from work. I’m not sure why my blue prints would be giving you errors, unless you did not have some of the global variables.
They didn’t. I saw runtime errors, like making a variable out of cast to saveGame node “saveGame instance” and then latter in code trying to get value out of that variable. Your save game BP exec node that leads to saveGame is not connected.
Good practice is that on event begin lets say HUD(any other BP will be good too)) you make a function that checks if save game exist and if it doesnt you set all values to their default and save it, thus making a save file at the start of the game. Latter you wont need to check is save game exist, you know it is there.
okey, so I pretty much copied your blueprints… unfortunately it still is showing the same problem… somehow it is reading the value of the score that is getting saved while I’m playing in the editor on andoird. I heard that 4.8 is coming out soon so I guess I will just mark your answer as correct and I can reopen if 4.8 does not fix it. thank you for your detailed explanations.