Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • PlayStream /
avatar image
Question by Michal Töpfer · Aug 25, 2016 at 07:44 AM · Leaderboards and Statisticsgame managerPlayStream

Event properties in PlayStream actions

I mean when creating the action, it could be possible to use some of the event's properties as the input.

Example: Increment player statistic: Change by (whole number)

com.playfab.player_statistic_changed.StatisticValue

or only

StatisticValue

Detailed Example: I want to have several level packs in my game and for each of them, I have a statistic that tells me, how many levels of the pack the player has played. I also want to have a statistic that will show how many levels the player played in total (a sum of all the statistics for each level pack). I know this is achievable through Cloud Script, but it seems to me like a really good and powerful enhancement to PlayStream. So I would create an action on player_statistic_changed with conditions that will match my level packs statistics and the action will be Increment player statistic TotalLevelsPlayed by value

StatisticValue - StatisticPreviousValue
Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Aug 25, 2016 at 07:55 AM

Actually, you can do this now, though what you really want is to use a Segment, so that you can use the Segment Enter to trigger the Action you want. For an action that's triggered when a statistic value gets to a certain point, you could set it up with the Conditions being StatisticName equal to your stat's name (ID), and the StatisticValue being the value you're looking for. However, if you set it to be equal to that value, you run the risk of missing that number in some cases, or hitting it multiple times if the value can go down. Meanwhile, if you use greater than, the Action will fire every time the player ups that statistic past that point. But if you use a Segment, you can set the Segment's conditions up the same way, but then only trigger the Action when the palyer enters the Segment.

Comment

People who like this

0 Show 5 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Michal Töpfer · Aug 25, 2016 at 08:09 AM 0
Share

I probably meant something a bit different. My case is not just once enter the segment, but every time the player plays a new level, I want to increment levelsPlayedInPack1 (or Pack2, ...) and also LevelsPlayedTotal stats. As I wrote, it is not hard to do in CloudScript, but I think this would add a lot of freedom to PlayStream.

avatar image Brendan ♦♦ Michal Töpfer · Aug 25, 2016 at 02:51 PM 0
Share

So is the issue that you don't want to use a Cloud Script in the Action to set the values, but rather, simply increment the values as the action? If so, you can still do this now by using the SegementName and SegmentValue as the Conditions, as I described above, and IncrementPlayerStatistic, as you described in the question. What do you feel is missing from this?

avatar image Michal Töpfer Brendan ♦♦ · Aug 25, 2016 at 03:04 PM 0
Share

I probably don't understand your answer with segments. I thought that when you have a segment, then something happens if player enters or exits the segment. But in this case I would have a lot of possibilities for the stats. Do you mean using multiple segments for that? I just want to have a stat that is sum of two (or more) other stats and updates whenever one of the stats changes (up or down).

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    1 Person is following this question.

    avatar image

    Related Questions

    PlayStream action for login first time. 1 Answer

    PlayStream Event API call limits 1 Answer

    Execute Cloud Script With Arguments 1 Answer

    Sending analytics events to Gcloud bucket 2 Answers

    How can I use actions with "character_inventory_item_added"? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges