Incremental Achievements question

Fabri DamazioFabri Damazio Member Posts: 97
edited July 2012 in Working with GS (Mac)
I have one doubt about incremental achievement.

I have one incremental achievement where the player need collect STARS. I use this formula:

(total_stars/100) *100

Every star collected is equal 1%

My question is: I need save the "total_stars" attribute or it need be zero every time i start the game?



Ex: if the player collect 5 stars. I need save 5 to "total_stars" to next time he play the counter start on 5 and increment? Or i don't need save it and when he start again it will start on zero?

Best Answer

  • LumpAppsLumpApps Posts: 2,881
    edited May 2012 Accepted Answer
    I think you need to save the total stars.
    In my game I have a atribute that is +1 every time the player does a certain thing. I update the game center achievement after each round with (total/goal)*100
    What I also do is ad a maximum to it. It's probably not a big deal but I can imagine game center freaking out if you send over 100% to it.
    So I do max(100,(total/goal)*100))
    Hope that makes sense.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It seems like you're asking if you should save the total_stars or not, but you don't explain how you want it to work. Do you want it to keep track of the previous number of stars? If so, save it. If not, don't.

    It's also a bit strange that you're converting the number of stars into a percent and then back to a whole number. The expression (total_stars/100)*100=total_stars... right? So no need for the formula. Just keep track of game.total_stars.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Fabri DamazioFabri Damazio Member Posts: 97
    It was an exemple. (a bad exemple)

    ok, lets suppose i use:

    (total_stars/500) *100

    Do i need save the total_stars or it needs to start always on zero to work with my achievements?

    Do i need save my total star to 500 to unlock the achievement or the gamecenter do it for me?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Okay, so I haven't used gamecenter achievements... someone else will have to help you. But now I understand what you're asking!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • LumpAppsLumpApps Member Posts: 2,881
    Ow, that should be min where it says max.
Sign In or Register to comment.