Q: save more then 1 value to single attribute?
POM
Member Posts: 2,599
hey is it possible to save about 20 different values to a single attribute "score" and use different keys for each value?
or we have to make 20 different attributes? (score1, score2, sco...)
or we have to make 20 different attributes? (score1, score2, sco...)
Comments
is it ok?
but ill do as you say, THANK TOU FOR YOUR ANSWER!
i love this forum
because the way i see is, if you save 5 different values, on the same attribute, they will overwrite each other and only the last value will be saved.
but maybe you found out some interesting there.
create a game attribute "test" (lets say integer)
create an actor with a rule: when touch is pressed-
change "test" to 10
save attribute key: A
change "test" to 20
save attribute key: B
change "test" to 30
save attribute key: C
create another actor with 3 rules:
1)
when touch is pressed:
load attribute key:A
2)
when touch is outside:
load attribute key:B
3)
when touch is released:
load attribute key:C
display text for that attribute and watch how a single attribute contains 3 values!
any explanation on how it works?!
if you never need to load all these saved attributes at the SAME TIME, i guess this is ok.
but for example looking at my own game, i cant see me using this on any of my attributes, because i need them all to work together, so i need separate attributes for different values.
but hey, nice finding anyway, might be useful sometime!
I have a question.. When I load a saved attribute it works fine
but the second load dosent seem to work. If I load the saved attribute, it's value vanished? Or it still there ?!
check to see if you are not saving black data (right after you open the game) and then after loading it. see if the rules are ok. also. you can only REALLY test this if you build a .app and open it in your iphone/ipod.
gamesalad viewer isn't very trustful with the save/load thing.
I'll test it, and if there will be a problem I'll ask For your advice.
thank you for your reply
why is this happening? need help please