Really sorry save and load issue
Hi, been struggling with this for ages, have watched the videos and read other peoples problems on the forum, I'm still stuck. I've put the save attribute on the scene so that when button is pressed it should save (game.scene). So far i have 5 scenes and on the main menu i have a resume button into which i have put the load attribute so when touch is pressed load game.scene. The resume button doesn't do anything when i tested it on AdHoc. Any help would be great as I'm pulling my hair out
thank you.
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
Best Answers
-
The_Gamesalad_Guru Posts: 9,922
Make sure the load is at the top of the code in the button and set a short timer like .5sec before it changes scene. -
stackpoole Melbourne, Victoria, AustraliaPosts: 473
No need to be sorry
If it is the Save and Load not working
MAKE SURE
you don't use the "e" when typing in the key
i.e. make sure the expression editor does not come out when typing in the key..
hope this helpedSydney Swans 2014!!
-
jonmulcahy Posts: 10,408
It's case sensitive so make sure that is the same.
Can you post a screenshot of your code? -
tatiang Posts: 11,949
@nakki1718 As much as it would be awesome to be able to simply save the current scene and load it again, you can't actually do that by just saving game.scene (integer) and then loading it. GameSalad doesn't know what to do with that attribute because it just thinks of it as a regular old integer. It could just as well be game.coins or game.score. Naming it "scene" doesn't make it a scene.
The only way to save and load the current scene is to save an integer (or index) value to a key -- as you've done -- and then when you load the scene value, to have a rule that says When attribute game.scene=1 --> Change Scene [Level 1]; Otherwise When attribute game.scene=2 --> Change Scene [Level 2]; Otherwise ... etc.New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
Thanks.
Thank you!!
Upload your file and put a link so we can have a look at what you are doing wrong.
It makes complete sense in theory in my mind what you have said I need to do and I get the load part I think, but the save part is still confusing me - no excuse but young baby in the house and no sleep for days isn't helping lol. If you have a minute can you show an example of the save/ load on the project i linked over to you? From that I can physically see what to do then implement throughout the whole game? Then this save load will stop being a nightmare.
Thank you again
And you need a way to increase the level attribute each time you advance. I added this to the Continue actor.
I sent you a PM with the link to the updated file.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Hope this helps,
Bray
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Thanks everyone for your help!