save/load attributes not working :((((
LumpApps
Member Posts: 2,881
Hi,
I have worked with the save and load attributes with success in my previous game but now it will not work. I load the game in the viewer but no attributes are loaded (or saved, it is hard to tell)
In a scene where the score is displayed after each level it saves attributes for example game.highscore to key highscore
In the first scene it loads key: highscore to attribute game.highscore
But it doesn't load at all.
For testing I did:
I've made a new project with just 2 scenes. In scene one it loads an attribute and in scene two I made a scoresystem like tshirtboots example and a save attribute. Didn't work
I have tried a template from tshirt and added the save load attributes as in tshirtboots video. Didn't work.
I looked at my previous game how I did it (the same as in the new game) and tried that on the viewer: it worked...
So the only thing I can think of is when I make a project in 0.96 (or 0.971 since I updated today) doesn't work but my project made in an older version works.
I can't imagine this is right but it is the only conclusion I can draw now.
I am getting angry at this, it took me over a day now of testing and it has come to that point where I would like to throw my iPhone out of the window
Does anyone have any idea what I am doing wrong?
Perhaps someone can send me a test-file made in 0.96+ with a simpple load and save function to see if that works.
HEEEEEEELP!!!!!
I have worked with the save and load attributes with success in my previous game but now it will not work. I load the game in the viewer but no attributes are loaded (or saved, it is hard to tell)
In a scene where the score is displayed after each level it saves attributes for example game.highscore to key highscore
In the first scene it loads key: highscore to attribute game.highscore
But it doesn't load at all.
For testing I did:
I've made a new project with just 2 scenes. In scene one it loads an attribute and in scene two I made a scoresystem like tshirtboots example and a save attribute. Didn't work
I have tried a template from tshirt and added the save load attributes as in tshirtboots video. Didn't work.
I looked at my previous game how I did it (the same as in the new game) and tried that on the viewer: it worked...
So the only thing I can think of is when I make a project in 0.96 (or 0.971 since I updated today) doesn't work but my project made in an older version works.
I can't imagine this is right but it is the only conclusion I can draw now.
I am getting angry at this, it took me over a day now of testing and it has come to that point where I would like to throw my iPhone out of the window
Does anyone have any idea what I am doing wrong?
Perhaps someone can send me a test-file made in 0.96+ with a simpple load and save function to see if that works.
HEEEEEEELP!!!!!
Comments
Lump Apps and My Assets
I would imagine its either how you are triggering the save. Or You need to double check your key. I did have a problem at one point But I found I have the key mistyped in a save.
You want to make sure your game has chance to save. So don't place the save behaviors in a rule that is only valid for a split second. If it save is inside a timer make sure run to completion is checked.
If its in a button make sure a change scene behavior is at the button since the engine reads the rule from the top down you might be triggering something that is happening before the save runs and essentially blocking it from happening.
Theres lots of possibilities of why an easy way to check is in preview hit play so that it begins with you loading screen and then after the save should have happened Click the little reset icon in the preview window. That will simulate closing and opening an App and as long as you previewed the app from the load screen it will reset and load and saved attributes you have setup. If they are not loading right I would look at triggering the save differently.
But first things first. Double check those keys.
Good luck
Edit: just read tenrdrmer's good answer but I'll check it out all the same.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
@Gyro, I appreciate any help. My head hurts, a painkiller would be nice too
Lump Apps and My Assets
It still loads the test value to all attributes I load so my guess is there is a problem with the loading not the saving... testing testing!
Lump Apps and My Assets
I moved the load attribute from the first scene to the second (my 'main menu') and now it works.
This must be a bug because I didn't change any of the load or save attributes only copied them from an actor in scene 1 to an actor in scene 2.
The only thing I don't like but I can live with it that it now loads every attribute again when it comes to the main menu.
Strange that I am the only one having this problem, not only in my new app but also in test projects, even when I follow tshirts save/load video.
Thanks guys for your help. The reset button in the creator tip really saved me lots of time!
Lump Apps and My Assets
Guys I have the same problem, and I can't fix it. Anyone?