question

Cyrille Bousquet avatar image
Cyrille Bousquet asked

virtual currency balance change rules,

Hi,

I'm trying to trigger a cloud script / azure function when a character virtual currency balance changes, but the only event types available in the list are com.playfab.player_virtual_currency_balance_changed which is about player virtual currency balance and playfab.inventory.virtual_currency_balances_changed which I have no clue what's for and couldn't trigger anything from it.

How can I use character_virtual_currency_balance_changed or entity_virtual_currency_balances_changed I see in the documentation ?

I found this old topic which mentions writing a player event, but that wouldn't work when we grant virtual currency from a bundle so I'm not sure it really matches the issue.

Cheers,

Cyrille // Bousk

,

entitiesCharacters
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

·
Gosen Gao avatar image
Gosen Gao answered

Currently, Playstream action triggers are not available for Character events, please feel free to post a feature request for it. You mention that “I found this old topic which mentions writing a player event, but that wouldn't work when we grant virtual currency from a bundle so I'm not sure it really matches the issue.” Do you mean it works when modify the Character’s Virtual Currency directly but not for bundle granted? When a bundle is granted, you can check If this bundle contains Virtual Currency. If it does, you can write player events when the bundle granted.

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.

Cyrille Bousquet avatar image Cyrille Bousquet commented ·

Hi,

I'm not sure to understand how to "write player events when the bundle granted". Is there a playstream event when a bundle is opened by a character ?

Also the goal was to have an event generic enough so whenever designers add a bundle or anything adding a virtual currency, then it would be triggered.
When I search for character in event type, there is 0 result, and if I use the corresponding player event type, it is not triggered when the currency is given to one of its characters.

Also, what's the difference between com.playfab.player_virtual_currency_balance_changed and playfab.inventory.virtual_currency_balances_changed ? I can't find a way to trigger the latter.

0 Likes 0 ·
kylemc@microsoft.com avatar image kylemc@microsoft.com Cyrille Bousquet commented ·

Hmm... is "playfab.inventory.virtual_currency_balances_changed" showing up in the triggers UX? That's probably a bug.

All "playfab.inventory..." events are part of the Economy V2 Public Preview. "items_added" where type = "currency" is the closest equivalent to "virtual_currency_balances_changed" in V1.

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao Cyrille Bousquet commented ·

Since there is no built-in event that suits to your case. So, when you need to trigger your Rule, for example, when the game logic grants Virtual Currency to a character or when players are going to get a bundle that contains Virtual Currency, you can write a custom event to trigger it. Please refer to Generating PlayStream events - PlayFab | Microsoft Learn.

0 Likes 0 ·
Cyrille Bousquet avatar image Cyrille Bousquet Gosen Gao commented ·

Would that mean that the client must be aware that the bundle it's opening contains the virtual currency so he can write the event ?

So we need to have this logic in every place and for everything which can potentially grant virtual currency ? Sounds troublesome compared to a proper playstream event :/ (which is even documented)

0 Likes 0 ·
Show more comments

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]