Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Neikke on January 09, 2018, 12:12:30 PM

Title: How to store Coins count for player?
Post by: Neikke 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!
Title: Re: How to store Coins count for player?
Post by: jeanfabre 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
Title: Re: How to store Coins count for player?
Post by: Neikke 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..
Title: Re: How to store Coins count for player?
Post by: jeanfabre 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
Title: Re: How to store Coins count for player?
Post by: djaydino 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.
Title: Re: How to store Coins count for player?
Post by: Neikke 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)
Title: Re: How to store Coins count for player?
Post by: djaydino 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)
Title: Re: How to store Coins count for player?
Post by: Neikke 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!
Title: Re: How to store Coins count for player?
Post by: djaydino on September 27, 2018, 06:27:33 AM
Hi.
Yes indeed it stores locally, but it has also actions to downlaod/upload