"Users" for each game? Tracking achievements?

freerangeeggheadsfreerangeeggheads Member Posts: 19
edited November -1 in Working with GS (Mac)
Are there any tutorials for how to create "users" for each game that will track that person's high scores, achievements, etc, and will stay there after the game has been closed and restarted? I know the old school way of doing this by writing to an external file in C and then parsing the data on reimport but I'm hoping there's an easier way to do that here. I'm completely new to GS! Thanks! :)

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Hey there. Welcome to GameSalad!

    This series of videos may be what you need.






    And you may want to bookmark the whole GameSalad Cookbook page as well, very informative material.

    http://www.youtube.com/user/GameSaladCookbook

    Welcome again, and it sounds like you know what you're doing, so I can't wait to see the stuff you come up with!
  • freerangeeggheadsfreerangeeggheads Member Posts: 19
    Thanks so much! I'm learning all this as I go...is an "attribute" in game salad akin to a variable? Can they be matrices? I'm so grounded in OOP I'm having a hard time switching over to a GUI interface though I'm sure it will be better once I make the transition. ;)

    For instance, if I wanted to create different difficulty levels is there any way to do THIS in GS:

    if (user.level==1)
    this happens or this state changes;
    if (user.level==2)
    this happens or this state changes;

    etc? I am just kind of lost with how "attributes" work in GS. :) Is there a manual or something I can read? Thank so much for all your help!
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Yes, what you are trying is very much possible.

    if (user.level==1)
    this happens or this state changes;
    if (user.level==2)
    this happens or this state changes;

    What you are describing here Is basically how attributes work in GameSalad. There is a wiki page that will describe all the different types of attributes, and what they are for, and a lot of other information you may be looking for.

    http://gamesalad.com/wiki/

    The specific page for the attribute description is here...
    http://gamesalad.com/wiki/how_tos:gsc_use_attributes
    and here.
    http://gamesalad.com/wiki/how_tos:gsc_create_attribute#what_is_an_attribute

    The "How To" page on the wiki is a great place to browse around as well.
  • stevethornstevethorn Member Posts: 35
    Hi freerange,
    Yes, attributes are your variables in GS. And when you create rules those are your IF statements. There is even an Otherwise with each rule so you can have an ELSE as well.

    As for the difficulty levels, you'll see there are Game Attribues as well, which are close to Global Variables and are probably the best place to have a difficulty level set.

    And bookmark what SlickZero has posted, these links are invaluable for learning GS. And if you can't find an answer, just ask, the users on this forum are phenomenal at helping each other.
  • freerangeeggheadsfreerangeeggheads Member Posts: 19
    Thanks so much everybody! :)
  • freerangeeggheadsfreerangeeggheads Member Posts: 19
    Oh, I forgot, one last question - I can see here how attributes work and how to keep track of score and achievements, but how can you be sure that this data won't be lost on restart or update?
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    You use the behaviors "Save Attribute" and "Load Attribute" on the data you want to keep track of and display at a later time. This stores the information from any built-in attribute, or custom attribute you create.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yep like slick said, you just want to make sure to have and your save attribute behaviors saving the attributes right after a change happens, and have all your load attribute behaviors on the first scene. And make sure the keys for the save and load match up as well
  • freerangeeggheadsfreerangeeggheads Member Posts: 19
    Oh I didn't realize those would save after restart! Is there any way to test this in a simulator to make sure that the app won't reset after an update?
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    The save and load attributes don't work in the GS preview, you are going to have to download and install the GameSalad Viewer to your iPhone. And you need the $99 a year Apple iOS Developer Account to do that. That's where you will be able to test your game.
  • freerangeeggheadsfreerangeeggheads Member Posts: 19
    Thanks for your help everybody!!!

    I've looked through the cookbook but i still can't figure out the Users questions.

    Is there a way in Game Salad to track achievements and scores, etc, for individual users? So when the game starts up you see "What's your name" and then you get a user name and then next time you click your name and all your information is saved.

    Is this possible in GS?
  • DreamLabDreamLab Member Posts: 2,127
    I can't give you specific rules to try, but I think what you could do is make 3 or 4 slots to be able to play on. Like accounts. you get to type the name of what you want the name to be. and so when you play under each account, the attribute it set to THAT specific name. Like I said, I can't give you full details on what to do as I am not a pro with GS. but I think it could be done that way.

    so what you could do, it at the main menu, they choose which profile they want to sign on. And as you would normally save score attributes, you would do it to every account. so like this

    if name1 is playing, name2 name3 and name4 are off. get it?

    and just record the attributes for each account.
  • freerangeeggheadsfreerangeeggheads Member Posts: 19
    Could I set it to a universal attribute, so that it wouldn't take 4x as much "code" to make it work?

    So currentProfile="user1" means all data is then saved to currentProfile.attributeName instead of user1.attributeName to avoid having code for every single user profile? How could this be done in GS?
  • DreamLabDreamLab Member Posts: 2,127
    is your game endless or with levels?
  • freerangeeggheadsfreerangeeggheads Member Posts: 19
    Levels :)
Sign In or Register to comment.