question

Ian Oliver avatar image
Ian Oliver asked

Is it possible to have PlayStream event when an inventory item expires?

An inventory item can be set to have multiple consume options. In particular, we are using inventory items for special offers that expire at a set time.

What we would like to track is the difference between special offer consumes (i.e.: purchase) and expiration. From the docs, and some testing, it appears that player_consumed_item does not fire when an inventory item expires and there is no corresponding expiration event. Specifically we would like to trigger actions when an inventory item expires...

Is there another way of tracking expiry that I am missing, or can we get a player_expired_item (or something similar) added to playstream?

Player InventoryPlayStream
10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

When any action occurs which "touches" the player inventory (like a call to retrieve the inventory), there's a pass to check the expiration times for consumables, and any which have expired since the last time the inventory was touched are removed. A service that tracks every consumable object and expires them in realtime, even if there's no player activity, would be expensive to operate. For us to be able to offer a free tier, and keep prices as low as possible for our paid tiers, we need to keep those costs down as much as possible.

But that said, what specifically are you trying to trigger when the inventory item expires? Given that the player may not be online at that point, is it a notification? If so, we do provide a plugin for Unity that allows for delayed delivery of Push messages on Android (we'll be providing one for Apple devices in a future release).

5 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.

Ian Oliver avatar image Ian Oliver commented ·

From my standpoint, I don't need the realtime event just an event when the item is removed because of expiration...

A couple of scenarios:

- use the play stream to track conversion rates for special offers. Purchase vs. Expired.

- use the expiration of a special offer as a trigger for a followup special offer. eg: a lower price with more stuff

0 Likes 0 ·
brendan avatar image brendan Ian Oliver commented ·

[edited for accuracy] In that case, we have a backlog item to add a player_inventory_item_removed (or something similar) which should cover your use case. It'll trigger when an item is revoked or expires, as described above.

0 Likes 0 ·
hoangkakadaylaptrinh avatar image hoangkakadaylaptrinh commented ·

"When any action occurs which "touches" the player inventory (like a call to retrieve the inventory), there's a pass to check the expiration times for consumables, and any which have expired since the last time the inventory was touched are removed."

I don't need to do this realtime, I just want to have my cloud script or whatever mechanism that PlayFab provides to process custom logic when an item expired on the server.

For my case, I do upgrading skills of character by purchasing upgrade item, when this special item expired, character's skill get increased.

Does this make scene to do skills upgrading this way? any suggestions are welcome.

Thanks.

0 Likes 0 ·
brendan avatar image brendan hoangkakadaylaptrinh commented ·

As stated above, if you're okay with the event occurring when the inventory is next updated (which could be days after the item's actual expiration date, if they player didn't sign in for that long), then the player_inventory_item_removed event we'll be adding will work for you.

As to whether that's the right way to do upgrades for skills, it depends upon the specifics. What are all the ways player can get that item - purchasing? Grants? Some combination? One thing to consider is, what's the maximum number of these items you'll be letting the player have, and is there any way to get many of them before some expire (given that they won't be stacked, but distinct)? For example, since you said "purchasing", would it be possibel for a player to stockpile VC and then purchase 100 of them in a row? Might the player exceed his inventory limit in that case?

1 Like 1 ·
hoangkakadaylaptrinh avatar image hoangkakadaylaptrinh brendan commented ·

Yes, that make sense.

For now, I restrict user to have 1 upgrading item in each character's inventory at a time, user can only buy another upgrading item after the current one finished or skipped

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.