What am I doing wrong...?
EnderGames.Co
Member, PRO Posts: 23
I have been trying for over a week now to use save and load attributes and they just aren't working for me. It's stopping from releasing my game and I'd rather not give up on this project. I've searched the forms and multiple tips and videos saying: "save score as: a" and "load score from a." But apparently I'm doing something wrong because that is not working at all. All I'm trying to do is get score to save after the game is closed and when you return your score still stays the same. Any help on the topi would be much appreciated. Thanks in advance.
Comments
You made an apk and it didn't work?
@smurfted yep, I'm at the stage when the apk is put into alpha testing in google's developer console and when I close the app, score doesn't save
Have you had it working in other apps before?
"apparently I'm doing something wrong because that is not working"
Too few clues.
@smurfted This is my first app so it's my first experience with this
In my experience saving and loading attributes is flaky. Try saving to a table instead.
@Socks What else would you like to know? My apologies, I'd give more information on the subject if I knew exactly what the issue is.
@strag Is there a tutorial that I could reference. I'm not too familiar with using tables
Tables are scary at first but can be your best friend in these situations...
@smurfted are there any tutorials I could look to help me?
Tables are more efficient, but saving attributes works as well if you just want to use them for a few things.
My guess is you may be confusing the KEY as what you are saving the attribute as?
Here is a picture of how the saving a loading should look.
You change the attribute to something, in this case 100. Most likely at the end of a level saving the high score. Then you make sure it is done slightly after with a timer, you save that attribute. You assign the save a key name. My guess is this is if you had multiple save slots or something? Like you could have 3 keys (savedata1, savedata2, savedata3) Not sure, I always just use one key. The big thing is the Key is NOT what the attribute is being saved as, it is just a key name tied to the save.
You then at the beginning of the game load the attribute, with the same key name you used, and it should load as 100.
www.rossmanbrosgames.com
A screenshot of your rules would be ideal, without seeing what it is that is causing the problem means the best people can do is make guesses.
YouTube is your friend...
@RossmanBrothersGames that's exactly what I have typed out. Quite literally, actually with the exception of it being in Windows format.
hmmm. it would be a good idea to post a screenshot here. also, make sure the keys are the same, putting a space at the end of one is always the kind of the that trips me up
www.rossmanbrosgames.com
Top picture is the actor containing the save data second picture is the actor loading the data.
the saving is taking place before the change, it happens .1 second after the actor is created. It needs to happen .1 second after the actor is touched.
www.rossmanbrosgames.com
This. +1
(drag the 'saving' section to just below the Change Attribute behaviour)
See how much simpler it is to diagnose an issue when you don't have to guess at what might be causing it !
@Socks Feeling a hint of negativity lol not sure of that's intentional but @RossmanBrothersGames can this change be viewed in the nativepreview or would I see this change in an Alpha test? Because when I exit, it still doesn't load the previously added scores.
I just find it odd that people can have all the information needed to resolve an issue on the screen in front of them, but don't feel it's important to include it in their question, I honestly find it puzzling/confusing more than anything (although I'm easily confused).
@Socks Well no hostility here if none is being dished to be fair my initial question was suppose to be the start of a much more in depth discussion. Hence, here we are
And to everyone thanks for the assistance. Issue not quite resolved and still utterly confused but I'll take what I can get and mess around for a few more days haha
Thanks!
That's a fair point, I'm just easily exasperated (too long on the forums).
@Socks Hahaha I'd take a well earned break then
I have an egg and an orange.
When I eat it, I feel sick.
Which one is causing the nausea ?
. . . . . . . .
I told you I was easily confused / exasperated.
Probably need coffee / wine / crack-cocaine.
You can't get rid of me that easily, I plan to complain about they way questions are asked until my parole officer and psychologist figure out I'm missing.
@Socks lmao fair enough!
It won't work in the preview on your PC, only in a built version of the game
www.rossmanbrosgames.com
@RossmanBrothersGames thanks for all your help