Load and save attributes

I am still perplexed regarding this load and save attribute function. I have a game, I want to save the high score so that the next time a person comes into the game it will be in the nifty text box for high score. However if the player wants to play again, right away, I reset the game from the score screen otherwise when moving to the screen all the variables for the game are still the same, not save, when I reset the game, the high score function gets reset. This is probably not making any sense. But in a normal world I would save this info to disk and then on load of the game or reset I would call that file from the disk. I think that there must be a way as people have made games that save the levels completed so you can CONTINUE which is close enough to a high score. I just dont get it. Anyone have a better explanation on how these two functions work, do they save the score somewhere on the iphone or is just in temp memory as long as the game is live. So help a didiot out here, if you have an answer throw it my way.
Thanks
Mike
Thanks
Mike
Comments
http://gamesalad.com/game/play/52365
Let me know if you have any questions.
Thanks
You are not the only one who feels that way. haha~
In GS save/load is not easy...
I'm trying to make an simple upgrading system for my game but oooh... not easy...
1) Create a game attribute (HighScore).
2) When the game ends, create a rule to check if the current score is greater than the high score (this could be changed to greater than or equal to if you prefer). If it is higher, use Save Attribute to save the HighScore attribute with the key of the same name (HighScore), just to make it simpler. If it is not higher, do not save.
3) In the first scene that loads in your game (for my game, it's the Main Menu), use Load Attribute on one of your objects (I put it in the Main Menu background image) to load the save key (HighScore) into the HighScore attribute. This way, when the app is quit and restarted, the value of HighScore is always reloaded too.
This method could also be applied to a linear progression of unlocked levels (i.e. you can't skip levels). For example, if you wanted to save the user's current level unlocked, you could use an attribute (Unlock) to load/save the highest level unlocked (the attribute's value gets incremented +1 after each level is finished). If the user quits the app, the next time they start it, their current level unlocked will be restored.
For a non-linear progression of unlocked levels (or something similar like achievements) that can be unlocked in any order, I'm guessing you'll probably need to use a separate attribute and load/save key to track each level/achievement.
I hope that helps!
I want to be able to build a game with Load and Save build in, for testing and playing ont he web, without the iPhone license included.
When will this be put into the application? Thanks.
GameSalad Creator Beta 0.8.2
* Load and Save attribute fixed for desktop publishing.
How does Save and Load work for desktop publishing?
I want to be able to save my player positionX and positionY on the main map scene as you enter a house for example, change scene to the "house", then when you exit the house scene, you are back at the main map scene, and start at the previous positionX and positionY for the player.
How can I do this?
It just seems to reset the scene, as far as I can tell...?
Would love to know!
solution:
create2 attributes in game Score Integer or real (i use integer)
HighScore Integer
Transfer to Score the value you want using a rule,
in the same rule,use other rule that say attribute game.Score >game.highscote
Change attribute game.highscore=score
Save attribute game.highscore key:highscore (i dont know why but you need to put the same name as the attribute, if not it does not run)
to show high score
load attribute
game.highscore key: highscore
display text game.highscore
and every time you close and open tha app, you going to have the value saved, just function using GS viewer in device, no function in GS creator (i think it function, but experts say not)
any way, if you want to reset that value, just add a change attribute game.highscore=0, togheter with the rule reset scene, or game, but in my opinion, is not logic to reset highscore, but if you want you can.
I just need to have my player actor set it's self.positionX to my attribute PlayerPositionX (and the same for Y), all the time, so that each time the scene starts, the player position is initially set from my attribute PlayerPositionX and PlayerPositionY, rather than the X,Y position set by where I've placed my actor in the scene in the editor.
Is there a way for me to save all my attributes between SESSIONS, without using a device? Such as if I wanted to let players play my game on the Game Salad website, and save their game progress?
Cheers!