saving and loading attribute not working?
RawanAlodeh
Member Posts: 51
in Help Wanted
hey guys
so i have published my game, but i have a big error that i need to fix asap
the thing is, after a level is finished, it unlocks the next level but if the player exits the game. only the finished level is unlocked
how do i fix this?
Comments
You use the Load and Save Attribute behaviors. Can you post screenshots of these?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
what is weird that it saves the level that is finished. 1st screenshot is the actor that my chaacter collides with at the end of the level. the second one is the lock on the level. the 3rd one is the load attribute
correction, 1st picture is the load attribute which is at the begining the "click to play" scene. 2nd one is the lock and 3rd one is the actor collides w/ to unlock next level
It's hard to tell from your screenshots but are you using a single Key for all of your unlock attributes? Also, in general I always make the Destroy behavior the last in the list since it's possible to destroy an actor and then not run any more behaviors (as you might expect).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yes i am using a single key for all unlocks. should i make a unique one for each level? okay ill try putting the destroy after and tell u
If you use a single Key then each time you save, you're overwriting the value of that Key.
You'll need a separate Key for each unlock. If you have more than about three values to store, I'd highly recommend using tables instead of Load/Save Attribute behaviors.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
how do i use tables?
i create a table with the number of levels. boolean and make level 1 true, then have ID for each level. but thats when i get stuck, how do i make the lock actor dispear when the level is unlocked?
You can try our free template below, it should have everything you need.
http://www.deepblueapps.com/level-select-system/
thank u, ive downloaded it. tried opening it but it says that gamesalad cant open gamesalad documents?
It was made with an RC build so try renaming the extension to .gameproj
No probs I will send you the normal version via email.