playMaker

Author Topic: How to create Achievements for Score and Money earned  (Read 1215 times)

Neikke

  • Full Member
  • ***
  • Posts: 134
How to create Achievements for Score and Money earned
« on: March 09, 2018, 09:06:55 AM »
Hi,

I have infinite runner with Score and Coin count, so I wanted to ask what would be the correct approach (from Playmaker perspective) to make a logic which would trigger a command for Steamwork's "Unlock Achievement" action. And also how would I make it so that it's not triggered every time I collect the same amount of score or coins. How would you recommend setting it up? Thanks a lot in advance!

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: How to create Achievements for Score and Money earned
« Reply #1 on: March 09, 2018, 10:48:48 AM »
Let's say you have "collect 500 coins" achievement. Besides having a resettable counter for current coins collected, you nees to have a total collected coins counter (that should be permanently stored via easy save or playerprefs) and a listener that will trigger the achievement once you get over 500 coins. The thing that will prevent from activating the achievement every time is a simple bool that will check if the achievement is unlocked every time the number of coins is checked. So you need a list of achievements with a bool attached. Best way is to make a hashtable of bool values where the key would be achievement name and bool is true/false (locked/unlocked) which is also permanently saved.
« Last Edit: March 09, 2018, 10:55:48 AM by krmko »
Available for Playmaker work