Q: save more then 1 value to single attribute?

POMPOM Member Posts: 2,599
edited November -1 in Working with GS (Mac)
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...)

Comments

  • mrfunkleberrymrfunkleberry Member Posts: 424
    20 different ones i'm afraid. 20 is not too harsh, just think how many tshirtbooth had to create for star daze. Good Luck
  • POMPOM Member Posts: 2,599
    exactly my point, i need to make 20 different attributes X6 (different achievements) so it will be 120! and counting..
    is it ok?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Stunt squirrels required about 160 attributes to be saved/loaded. I didnt notice any problems.
  • POMPOM Member Posts: 2,599
    so just to be on the safe side, you guys recommend the second method?!
  • nulonulo Member Posts: 315
    its not a recommendation. you have to do it that way ;)
  • POMPOM Member Posts: 2,599
    that is not entirely true , cause i did saved 5 different values to a single attribute, and load them with 5 different keywords! (i dont know where this data is saved to, try it, it works)

    but ill do as you say, THANK TOU FOR YOUR ANSWER!

    i love this forum
  • nulonulo Member Posts: 315
    wait. could u explain "5 different values to a single attribute"?
    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.
  • POMPOM Member Posts: 2,599
    very simple:
    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?!
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    Almost sounds like a bug, not a feature...
  • nulonulo Member Posts: 315
    oh i see. the thing is you save attributes at different times.
    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!
  • POMPOM Member Posts: 2,599
    Ok I see... I'll use the second method anyway cause it work for shore.

    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 ?!
  • nulonulo Member Posts: 315
    its 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.
  • POMPOM Member Posts: 2,599
    Good to know!
    I'll test it, and if there will be a problem I'll ask For your advice.
    thank you for your reply
  • POMPOM Member Posts: 2,599
    i dont know why but when i load a saved attribute- sometimes it change it to the last save, but sometimes it show the current value even when there is a rule to load the last save!
    why is this happening? need help please
Sign In or Register to comment.