saving and loading attributes
mshuraih
Member, PRO Posts: 179
anyone having trouble in loading saved attributes, I tried all the trouble shooting mentioned before still not working i have my load attribute behavior at the initial screen and saving the attribute at the game paly scene ( score and coins )
Comments
Something to keep in mind is that the key names must match exactly when you load and save attributes. Post screenshots of your load and save attribute behaviors so that we can help you troubleshoot further.
Have you used Log Debugging Statements right before your load and save attribute behaviors to verify that they are indeed triggering? If so, what was the result of those statements?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I m not sure how to use the debug function .. the keys are matched
Just a question, are your actors in the scene?
Any expression you put in the Log Debugging Statement behavior appears in the Debugger window (access it from the View menu).
So you can type "made it here!" or "should save attribute now" or an actual attribute such as game.Time or anything else you like. If you place them strategically throughout your rules, it's easy to see what's happening or not happening that should be.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
The load attribute and save attribute didn'g work on the gamesalad preview to see it work you need to preview them in the ios or in te android viewer
It is much better to do this with tables and they are reliable. Look for the Tables video here
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
I looked over the forum and seems some people has similar issues .. and finally i was able to figure it out .. SO here is what the deal after many trials and erros .. the save attribute is present at actor in the game scene so once the game kicks in it will save the default numbers ( before the score is changed) .. i have rules to save the score when the game is over or won ..etc so this is how the key gets updated ... but if u just exit the game in the middle of the play without an event that will trigger the save attribute then when u reload it will re load the default value that was saved in the first place .. so to keep track of the score and come back to the same value i created actor who keeps updating the save attribute everytime the score changes .. and it works
thanks all!