question

MoonHeonYoung avatar image
MoonHeonYoung asked

PrizeWheel sample prj question!!

Hi, I am about the git hub project prizeWheel project I'm studying.

I have the following questions:

I double-clicked the "Spin" button.

I received a bundle for PrizeWheel1, about the probability You have won the Card2 item.

Why is the PrizeWheel1 bundle item not removed from my inventory?

(In my opinion, when you buy a bundle, the bundle is deleted and you should only have random items inside the bundle.)

2. I also added ClientAPI.PurchaseItem () to another item in my main category with the code for this project.

Why did I buy two apples on my inventory? (I only bought one time)

125125151.png (309.6 KiB)
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

It's going to depend in part on how you have configured your title, since that's as much a part of the logic as the script code. The way that sample (https://github.com/PlayFab/PlayFab-Samples/tree/master/Recipes/PrizeWheel) works is that you specify a virtual currency which is used to "pay" for spins on the prize wheel. The VC is decremented by one for each spin, and each spin adds an item specified by your configuration (usually using a drop table for randomization).

Now, as to Bundles, they are simply items that come with other items included. They are not auto-consumed the way Containers are, because they're not meant to. If you want the Bundle to go away after adding the items it comes with, set it to Consumable with a Period of 3 or 4 seconds. That way, it will clean itself up after that amount of time.

For PurchaseItem, it can only be used for VC purchases using the items and prices you have specified in your catalogs and stores. It cannot add more items than are specified by your configuration. If you received two of an item, that would mean that either two were purchased, or something else in the game configuration (like a PlayStream Action, for instance) added the other. What I would advise is checking your event history for the player, to see why each was added.

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

MoonHeonYoung avatar image MoonHeonYoung commented ·

Another question, I know that "bundles" are unpacked at the same time as purchases. If so, should not it be consumable? I think bundles should disappear as soon as they open. Or is consumable and instackable an option to coexist? After saving this, can I open the bundle again from the inventory later?

0 Likes 0 ·
brendan avatar image brendan MoonHeonYoung commented ·

Bundles do not work that way, and we cannot make any change to this behavior, as that would be a breaking change for every title using bundles currently.

If you want the bundle to clean itself up after the other items have been added, you should set them to be consumed after a few seconds.

Alternately, yes, you could set the bundle to be a stackable item, so that it only ever takes up one slot in the user's inventory.

However, there is no such thing as "opening" a bundle. That concept only exists for containers. The bundle and all items included with it are added to the player inventory at the same time.

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.