Key for saving and load attribute

I'm sorry but I cannot understand how use "key" value in saving and loading attributes.
Imagine I can play with 2 different players, male and female, and each one has a score, a level as example.
Must the key be different form one to other or not ?
example:
Male Player:
attribute: score.level ; key: MALE
attribute: game.level; key: MALE
Female Player:
attribute: score.level ; key: FEMALE
attribute: game.level; key: FEMALE
Or instead a key different for each, as :
attribute: score.level ; key: SCORE.LEVEL.MALE
attribute: game.level; key: GAME.LEVEL.MALE
?
Thank you
Imagine I can play with 2 different players, male and female, and each one has a score, a level as example.
Must the key be different form one to other or not ?
example:
Male Player:
attribute: score.level ; key: MALE
attribute: game.level; key: MALE
Female Player:
attribute: score.level ; key: FEMALE
attribute: game.level; key: FEMALE
Or instead a key different for each, as :
attribute: score.level ; key: SCORE.LEVEL.MALE
attribute: game.level; key: GAME.LEVEL.MALE
?
Thank you
Comments
Every attribute you save should have a unique key attached to it.
Remember you can only check saving on your phone through the viewer, not in preview mode on your Mac.
Additionally, the key is case sensitive. So if you use Male to save, and male to load, it won't work - they both have to be the same!
Hope that clears up any confusion!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
So, if I have an attribute called lastCompletedLevel, I make my key the same name. It makes it easier to keep track of.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
I also just use lowercase - easier NOT to make mistakes
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
the key you create goes into the first column and needs to be unique. this is how the game engine will find the value you want to save.
that's how I imagine it anyways.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
"mykey"
not
mykey
The second version will causes keys to overwrite each other, which can cause major debugging headaches. I've just wasted two days because that *isn't* mentioned in the docs anywhere, and no error is flagged when it's done improperly.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Whenever you want to type custom text into the expression editor, you need to stay away from hitting that little "e" at the end. Otherwise, GameSalad thinks it's an expression parameter and it nulls out. If you DO hit the little "e" at the end, just click "remove expression" and it should resolve your issue.
So the fix :
- Create your save/load attributes within your actors
- Type in your "levelswon" and "totalscore" keys (don't hit the "e"!)
Also @ QS For his comment from months ago. In the preview Clicking the reset icon is the same as closing and re opening on a device. Just make sure you have previewed from the beginning otherwise clicking that reload will not work right. But that is a great quick little way to test your save an loads.