question

nexttechphilly avatar image
nexttechphilly asked

Setting the aggregation to max via could scripts

Is there any way to set the aggregation type via a cloud script?

CloudScript
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nexttechphilly avatar image nexttechphilly commented ·

@Brendan any ideas?

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

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?

6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nexttechphilly avatar image nexttechphilly commented ·

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

0 Likes 0 ·
nexttechphilly avatar image nexttechphilly commented ·

@Brendan I hope that helps explain

0 Likes 0 ·
brendan avatar image brendan nexttechphilly commented ·

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)?

0 Likes 0 ·
nexttechphilly avatar image nexttechphilly commented ·

@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?

0 Likes 0 ·
brendan avatar image brendan nexttechphilly commented ·

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.

1 Like 1 ·
nexttechphilly avatar image nexttechphilly brendan commented ·

Thanks @Brendan

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.