playMaker

Author Topic: How to store Coins count for player?  (Read 3146 times)

Neikke

  • Full Member
  • ***
  • Posts: 134
How to store Coins count for player?
« on: January 09, 2018, 12:12:30 PM »
I have a simple infinite runner type of game, so I store scores in leaderboards. But where and how should I store Coins count collected by the player? Create another Leaderboard for that specifically? Thanks in advance!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to store Coins count for player?
« Reply #1 on: January 10, 2018, 01:57:09 AM »
Hi,

 It depends what technology you are using for your current leaderboard.

 typically, you will need to save this as yet another value either in the playerPrefs or on a system ( a cloud based game database or somethibg like that);

 Bye,

 Jean

Neikke

  • Full Member
  • ***
  • Posts: 134
Re: How to store Coins count for player?
« Reply #2 on: January 10, 2018, 06:10:27 AM »
Hi jeanfabre,

I'm using Stan's iOS native plugin for leaderboards. Coins are collected using this method:
Code: [Select]
public class Coin : PickableObject
{
/// The amount of points to add when collected
public int PointsToAdd = 10;

protected override void ObjectPicked()
{
// We pass the specified amount of points to the game manager
GameManager.Instance.AddPoints(PointsToAdd);
}
}

Is it clearing up anything? Sorry I'm really bad at coding..

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to store Coins count for player?
« Reply #3 on: January 11, 2018, 12:10:32 AM »
Hi,

 uhm I see. Have you contacted Stan on this? Maybe is leaderBoard system has this feature built in?

 Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to store Coins count for player?
« Reply #4 on: January 11, 2018, 02:07:45 AM »
Hi.
If it is the "google play game services" leaderboards then unfortunately you are limited to a single value.
So you would need to make 2 separate leaderboards,or maybe build your own database.
Maybe there is another solution on the asset store try looking for leaderboard or high score.
If you find an asset and there are no actions, let me know and i can see if i can make actions for it.

Neikke

  • Full Member
  • ***
  • Posts: 134
Re: How to store Coins count for player?
« Reply #5 on: January 11, 2018, 05:09:24 AM »
Thanks guys, but just thinking.. can't I just store this simple Coins count value as an Int in PlayerPrefs (using PlayerpRefs actions)? Of course you will lose your coins on game uninstall, but isn't it a common thing for modern games - to lose all your coin count with game uninstall? (of course scores will remain as they're saved on Platform side)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to store Coins count for player?
« Reply #6 on: January 11, 2018, 01:16:46 PM »
Hi.

For google/android there is cloud save.
But i think for Ios there is not (nor something similar)

You can store on PlayerPrefs, but i would suggest to get 'Easy Save' as PlayerPrefs is easy to hack (cheat)

Neikke

  • Full Member
  • ***
  • Posts: 134
Re: How to store Coins count for player?
« Reply #7 on: September 27, 2018, 05:31:40 AM »
Sorry for bringing this up again but just to clarify. Using this Unity Asset "Easy Save" - all data will be just stored locally on a corresponding device (iOS, Android, PC) regardless of Platform? And of course gone with uninstall of the game, right?

Thanks a lot in advance!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to store Coins count for player?
« Reply #8 on: September 27, 2018, 06:27:33 AM »
Hi.
Yes indeed it stores locally, but it has also actions to downlaod/upload