Is there any way to set the aggregation type via a cloud script?
Is there any way to set the aggregation type via a cloud script?
Can you let us know what your scenario is, specifically? The statistic aggregation method can be set via Create/UpdatePlayerStatisticDefinition, but those are Admin API calls, as they are used for defining your title in our service, which should be quite rare. In what context would you need to call that from Cloud Script, exactly?
Well i made a cloud script to update a players high score statistic for the current level but the issue is that the leaderboards are made dynamically but needs to be set to max and not last
Yes and no. There's a limit to the number of leaderboards you can have, so when you say they are dynamically generated, what does that mean? Are you trying to support a model where you'll have players creating new statistics in your game post-launch? If so, please provide specifics. If not, why are you unable to set the leaderboard aggregation method via the Admin API or the Game Manager (either as part of setting up the statistic in the game, or as a follow-up step during testing)?
@Brendan the Stat is created after the user passes each level and adds their high score for that level. Its like how candy crush does it. What it the max number of leaderboards allowed?
It depends upon your tier. Your Settings->Limits page shows your current statistics limit. The new leaderboard system we're working on (https://blog.playfab.com/blog/upcoming-roadmap-2019-q1-jan-march-edition) will allow for higher numbers of leaderboards. We'll have more details available on that as we roll it out.
For your current usage, players don't have unique leaderboards. Each statistic created in your game is a leaderboard, and all players who write to that statistic are writing to the same leaderboard. So your best bet is to set your aggregation method either as a setup step for the game overall, or simply set it after you create it in testing per level.
2 People are following this question.