What am I doing wrong...?

EnderGames.CoEnderGames.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.

«1

Comments

  • smurftedsmurfted Member, PRO Posts: 586

    You made an apk and it didn't work?

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @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

  • smurftedsmurfted Member, PRO Posts: 586

    Have you had it working in other apps before?

  • SocksSocks London, UK.Member Posts: 12,822

    "apparently I'm doing something wrong because that is not working"

    Too few clues.

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @smurfted This is my first app so it's my first experience with this :blush:

  • RedRoboRedRobo Member, PRO Posts: 682

    In my experience saving and loading attributes is flaky. Try saving to a table instead.

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @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.

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @strag Is there a tutorial that I could reference. I'm not too familiar with using tables :neutral:

  • smurftedsmurfted Member, PRO Posts: 586

    Tables are scary at first but can be your best friend in these situations...

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @smurfted are there any tutorials I could look to help me?

  • RossmanBrothersGamesRossmanBrothersGames Member Posts: 659

    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.

  • SocksSocks London, UK.Member Posts: 12,822

    @EnderGames.Co said:
    @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.

    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.

  • RedRoboRedRobo Member, PRO Posts: 682

    YouTube is your friend...

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @RossmanBrothersGames that's exactly what I have typed out. Quite literally, actually with the exception of it being in Windows format.

  • RossmanBrothersGamesRossmanBrothersGames Member Posts: 659

    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

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23


  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    Top picture is the actor containing the save data second picture is the actor loading the data.

  • RossmanBrothersGamesRossmanBrothersGames Member Posts: 659

    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.

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2017

    @RossmanBrothersGames said:
    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.

    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 !

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @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.

  • SocksSocks London, UK.Member Posts: 12,822

    @EnderGames.Co said:
    @Socks Feeling a hint of negativity

    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).

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @Socks Well no hostility here if none is being dished :smiley: to be fair my initial question was suppose to be the start of a much more in depth discussion. Hence, here we are

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    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 :smile:

    Thanks!

  • SocksSocks London, UK.Member Posts: 12,822

    @EnderGames.Co said:
    @Socks Well no hostility here if none is being dished :smiley: to be fair my initial question was suppose to be the start of a much more in depth discussion. Hence, here we are

    That's a fair point, I'm just easily exasperated (too long on the forums). :)

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @Socks Hahaha I'd take a well earned break then

  • SocksSocks London, UK.Member Posts: 12,822

    @EnderGames.Co said:
    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 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.

  • SocksSocks London, UK.Member Posts: 12,822

    @EnderGames.Co said:
    @Socks Hahaha I'd take a well earned break then

    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.

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @Socks lmao fair enough!

  • RossmanBrothersGamesRossmanBrothersGames Member Posts: 659

    It won't work in the preview on your PC, only in a built version of the game

  • EnderGames.CoEnderGames.Co Member, PRO Posts: 23

    @RossmanBrothersGames thanks for all your help

Sign In or Register to comment.