Saving attribute not working between sessions. Anyone can help?

dieseljesusdieseljesus Member Posts: 50
edited November -1 in Working with GS (Mac)
Hiya! Working on our first game and we would like to save the highscores. What i do is save the highscore with key "HighScore1", i also load it as "HighScore1". This is done after checking that the gamescore is higher than the highest Highscore. If it is, it saves it.

I get it working perfectly inside the game. If someone sets a record, its saved, and the next time you check the list, its at the top.

The problem however is that if i quit the game, and start it again. None of the scores are saved. If the case is that it cant be saved permanently, the idea of the game is lost. The object of the game is to beat highscores, and if it cant be saved, whats the point of keep developing it!

Any ideas is appreciated! :D

Comments

  • dieseljesusdieseljesus Member Posts: 50
    Also, another question that i forgot to ask. Can i get the particles to fade? Im doing a particle explosion, and im trying to do a "color changes to" and set the "to" value to a 0% alpha value in the drop box. Its not working tho. The particles just dies, and that looks pretty strange! Any ideas how to get this working?
  • design219design219 Member Posts: 2,273
    Do you have a behavior to load the high score when you restart the game? Usually, in the menu scene or whatever your first scene is works best.

    I've never used particle, but there is info on how to fade in and out in the Support section.

    _______________

    Tickle Stones http://itunes.apple.com/us/app/tickle-stones/id363484260?mt=8
    Food Fight! (free) http://itunes.apple.com/us/app/food-fight/id352646643?mt=8
  • dieseljesusdieseljesus Member Posts: 50
    Hey. Thanks for the reply. Yes, i have a Load Attribute behavior at the highscore screen. It loads the attribute that i saved earlier. It works all the time, as long as i dont exit the game and start it again. Its like it just saves to memory and not to the key.

    Im using the same load key as the save key. Exactly the same.
  • design219design219 Member Posts: 2,273
    If you are loading and saving on the same scene, you may have a little conflict going on. You might try a timer to delay the save, like "after .o1 seconds, save high score".

    Are you doing a save only if the new high score is > the saved high score?
  • dieseljesusdieseljesus Member Posts: 50
    Im gonna try the delay now. What i do is save the attribute to gamescore when the gamescore is higher than the highscore, but i also added a the same save attribute at the game over screen.

    The Load attribute im using at the splash screen in the beginning of the game
  • dieseljesusdieseljesus Member Posts: 50
    i CANT get this to work. Now its also showing the wrong value. Im testing it and get like 1000 points, and it shows some random number like 40 or something that highscore list.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Hey there, I had problems like this in my game awhile back, you probably have all the right stuff, you probably just don't have it in the right place.

    On my main menu, it shows you your high score, its convenient because you don't have to open anything and its there right when you open it.

    So to show my main menu high score it says: display text (game.highscore) then it says load attribute: (key: highscore load attribute game.highscore)

    Then when you die, you change scenes and it takes you to an options menu that displays the score you just got: display text: game.highscore, rule when game.score > game.highscore
    change attribute game.highscore to game.score, (in same rule, save attribute: game.highscore, key: highscore)

    This is what worked for me, Good Luck! :)

    ___________________________________________________________
    (JetPacked!) http://itunes.apple.com/us/app/jetpacked/id361063574?mt=8
    ___________________________________________________________
    (JetPacked! HD) http://itunes.apple.com/us/app/jetpacked-hd/id365205067?mt=8
  • dieseljesusdieseljesus Member Posts: 50
    Hi, thanks for the help. Im doing exactly that, and most of the time i see the right saved highscore, but when i reset the game and start it again, the highscore is down to 0.... in the actual game, i can go back and forth between the different scenes and it saves it, but as soon as i quit it, its gone.... Isnt it supposed to save the attribute? Like i said, i did exactly what you said, but its still not working.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Is this for an iphone/ipad/desktop game? As it does not work for web, or over the preview player when you leave that view.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Also,

    "Also, another question that i forgot to ask. Can i get the particles to fade? Im doing a particle explosion, and im trying to do a "color changes to" and set the "to" value to a 0% alpha value in the drop box. Its not working tho. The particles just dies, and that looks pretty strange! Any ideas how to get this working?"

    Use the interpolate behavior, trust me it works great, just put it in my update:)

    ___________________________________________________________
    (JetPacked!) http://itunes.apple.com/us/app/jetpacked/id361063574?mt=8
    ___________________________________________________________
    (JetPacked! HD) http://itunes.apple.com/us/app/jetpacked-hd/id365205067?mt=8
  • dieseljesusdieseljesus Member Posts: 50
    Codemonkey: Its for an iphone game. I got it working in the actual game now in a few of the scenes, but not in one scene. The strange thing is that the scenes are exactly the same, the only difference is the difficulty + the background. Apart from that, its the same actors!

    Chosenstudios: Hey, also tried the interpolate function. Got the actual actor to fade (Showed an image) but the particles did not fade. Its like the particles are enteties/actors of its own that does not fade.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Are you actually testing it on an iPod / iPhone? If so and it still doesn't work, you might have to look through your game to find some old saving rules that are interfering, that you might have forgot about. (that happens to me all the time haha)

    "Codemonkey: Its for an iphone game. I got it working in the actual game now in a few of the scenes, but not in one scene. The strange thing is that the scenes are exactly the same, the only difference is the difficulty + the background. Apart from that, its the same actors!"

    are the particles set to the image your interpolating? because that should do it:)

    ___________________________________________________________
    (JetPacked!) http://itunes.apple.com/us/app/jetpacked/id361063574?mt=8
    ___________________________________________________________
    (JetPacked! HD) http://itunes.apple.com/us/app/jetpacked-hd/id365205067?mt=8
  • dieseljesusdieseljesus Member Posts: 50
    Hey guys. I decided to redo the scenes. and ill be able to tell you all if it works in a few minutes! :D Instead of having levels easy, medium, hard and extreme, ill just skip the easy one.

    About the particles. I got the image to fade but not the particles.... :D Must be something i forgot, but about the score... it was all the same scene basically, and just saving to one higscore for testing purposes... it seems there is some bugs with this... thats not strange tho since its a beta! :D It works pretty good tho
  • dieseljesusdieseljesus Member Posts: 50
    Thanks for all help.. think i got it sorted out now. dont know what it was, but i had to do the same thing over again to get it working. I have another question tho. Anyone knows this:

    How can i check when a game-flag is increased and then do something?

    I want to do something like this:

    When Game.Flag = Game.Flag+1 then do X.

    Im working on a chain function, and to get it working properly, i need to see when the my actor counter is increased. Anyway to get that working?
  • chosenonestudioschosenonestudios Member Posts: 1,714
    I think I understand what your getting at:

    your saying: game.flag = 0
    then for whatever reason do game.flag+1
    then check for when game.flag = 1 then do this?

    is this what your saying?

    ___________________________________________________________
    (JetPacked!) http://itunes.apple.com/us/app/jetpacked/id361063574?mt=8
    ___________________________________________________________
    (JetPacked! HD) http://itunes.apple.com/us/app/jetpacked-hd/id365205067?mt=8
  • dieseljesusdieseljesus Member Posts: 50
    Hmm.. not really. I want to do a chainer... That starts counting a timer for 5 seconds whenever you kill the first actor, and if i get 3 kills within a 5 second time, i get a chain bonus. With this i want to start the timer when for instance a killcount, score or whatever is triggered. For that i was wondering if there is a possibillity to do a:

    When Attribute KillCount = KillCount+10.

    At the momet i have a timer that constantly is counting from 5 to 1 and then from 5 to 1 again.. looping. If i score 3 kills within that time, i get a bonus. The problem however is that sometimes you do get 2 kills when its only 2 second left, or you get 3*2 (6 kills = 2 chainbonuses) within that time.... its not optimal, and i would love to be able to do a flag when something is increased.

    Another thing. Our game is really fun. We cant stop playing it. The mechanic is 3 different colored buttons at the bottom of the screen. From the top, orbs come falling down. Starting slow, and speeding up. You have to press the right button first, and then tap that color orb. After a while its like a dance game or guitar hero game where you cant stop playing, trying to beat the high score. The problem however is that i CANT get some stuff to work. Right now its the triggering of sound effects. Sometimes they are not playing at all... and sometimes some of them play. A few minutes ago, the simplest 500 byte sample that was on the buttons stopped working for no reason. Stuff that worked before stopped working now, and all of a sudden my save score started working.

    and then sometimes whatever i add to the actor slows it down sooo much. What we need is a super quick game where you NEVER miss a touch on the screen.

    Right now its feeling a bit sluggish when you get to the higher levels. i have between 4-7 actors on screen depending on level. They are non animated, dont have any effects, no sounds and nothing. The only rules i have on the actors are counters and hit rules. 1 rule saying that the actor will be killed if it collides with the player, and 1 rule that says that it should die when you touch it. Apart from that its score counting, actor counting and destroy behaviours. Not too much complicated stuff going on there, but still feels a bit sluggish and jagged a bit in the game. Is this because of the engine being slow? Im doing 2 games in unity and there i have a 2d game going on with 20-30 actors workin at the same time without slowing the system down.

    Any ideas? I would appreciate if someone maybe could take a look at this and see what might be a problem. I would love to be able to have working sound effects on the orbs etc. Please help me out here! :D
  • dieseljesusdieseljesus Member Posts: 50
    Ahh, also the above idea for the counter.. it could probably also be used like this:

    When KillCount = KillCount+1 (or whatever!) play sound.

    See what im after? I want to trigger something when something else is increased or decreased.
  • dieseljesusdieseljesus Member Posts: 50
    Hmmm update: Whenever i get a highscore at the game now, it saves it with a -50 state somehow.

    If i get 5500, it shows the score as 5450.....

    is it me or is this software jinxed or something?!
  • chosenonestudioschosenonestudios Member Posts: 1,714
    "Hmm.. not really. I want to do a chainer... That starts counting a timer for 5 seconds whenever you kill the first actor, and if i get 3 kills within a 5 second time, i get a chain bonus. With this i want to start the timer when for instance a killcount, score or whatever is triggered. For that i was wondering if there is a possibillity to do a:"

    Ok heres what you can do: after you kill the first actor make it flip a switch, when attribute blankedy blankedy = whatever, than for 5s if chain attribute = whatever than do this, (give you extra points or whatever)

    hey sorry about this, I have to go, I'll try and come back soon and see if you've got this worked out and if you don't I'll help you, sorry about that, ugh almost had it done, sorry g2g! Good Luck! :)

    ___________________________________________________________
    (JetPacked!) http://itunes.apple.com/us/app/jetpacked/id361063574?mt=8
    ___________________________________________________________
    (JetPacked! HD) http://itunes.apple.com/us/app/jetpacked-hd/id365205067?mt=8
  • dieseljesusdieseljesus Member Posts: 50
    Crap. Have been working on the HighScore list save. It worked perfectly. Clean system that was implemented the right way. Today, it started saving highscore "6500" as "5950" and "5200" as "1800" eetc.... really really strange. Then i just resynced the app, and it started saving the Highscore right again. It saved "4500" as "4500" etc. Then i sent the app to one of the dudes thats in the team, and he said that it DOESNT save ANY score on level easy and level hard, and on extreme it saves totaly wrong.

    Whats the matter with this? I know the scripting is right, and i got it working for a day or so, but then without any change, and by just resyncing it got it working again. Is this a program bug or what is it?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    make sure that one of the dudes thats in the team is deleting the app off of his device first, before syncing the new one.

    He might still be testing with the old one.

    Perhaps you should make a version number visible in the app.
  • dieseljesusdieseljesus Member Posts: 50
    Yes, we have a version number on the first page + we always sync it this way.

    1. Delete it from phone via itunes by unchecking the app there.
    2. delete it from programs in itunes list.
    3. Drop the new appversion into itunes
    4. sync.

    Its clearly visible what version it is and we all see the latest version number.

    I tried another thing now. I had an actor called ScoreCounter in the different levels, and i edited them as an instance. Now i did 3 different actors instead. What do you think of that? I hope it helps.. the strange thing is that its working for a while, then its not and then it is for a while. It doesnt feel stable.

    Btw. thank you alot for all help! :D
  • dieseljesusdieseljesus Member Posts: 50
    Hehee... tested it again, and now it saves around 200 below the right highscore... what i did to try to solve it is a timer that checks the state all the time, instead of just "when highscore > than gamescore" .... now i check for the state every second.... the strange thing is that my system worked perfect for a while, then stopped working, then started again...
Sign In or Register to comment.