attribute problem

sdx1987sdx1987 Member Posts: 44
edited November -1 in Working with GS (Mac)
i make a scenes to change the attribute,how to save the attribute so that i can use the attribute when i open the app the next time

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Use the Save Attribute behavior.
    http://gamesalad.com/wiki/behaviors_reference:save_attribute

    Also the Load Attribute behavior when you app opens.

    The keywords will need to match exactly between the Load and Save behaviors
  • sdx1987sdx1987 Member Posts: 44
    i did this,but it is not work.
    i think i did a wrong why.

    i creat 2 actors at the first scene,and give the one a save atrribute behavior ,the keyword is a1,

    and give another one a load attribute behavior,the keyword is a1 too.is it right?

    if i can use the gs view "recent games to" test it?
  • sdx1987sdx1987 Member Posts: 44
    thanks, i'll try this way.
  • sdx1987sdx1987 Member Posts: 44
    still not work
    defult game.attribute.A = 1
    in scene 1,when touch press ,constrain game.A=2, and save attributte = a1
    in scene 2,when touch press,load attribute=a1
    but when i open app again the game.attribute.A=1
    is it a wrong way?
  • sebmacflysebmacfly Member Posts: 1,018
    at the first scene (Title scene for exemple) you can add an actor out of the scene and add it a behavior "Load attribute"
    And in your game, save the attribute when you need it... that's all

    PS : you have to use the same name (exactly) for Save and Load!
    If you save in SaveA1, Load SaveA1, not savea1...
  • sdx1987sdx1987 Member Posts: 44
    thanks
  • sebmacflysebmacfly Member Posts: 1,018
    You're welcome :)
Sign In or Register to comment.