question

Canberk Soner avatar image
Canberk Soner asked

Containers with duplicate drops from drop tables

Let's say I create a container called WeaponChest and define its contents using a drop table, and I want my WeaponChest to drop multiple items from this drop table so I set the Quantity of container content to desired amount.

Let's call the drop table Weapons and put Sword, Axe, Spear and Bow to it with equal weights.

If I define my WeaponChest to have 1 drop from Weapons, then I get either a sword, axe spear or bow, randomly, as expected.

However, if I set the quantity to, let's say 10 and open the container, I always get 1 sword, 1 axe, 1 spear, 1 bow I never get duplicate items, even when I set the amount to something greater than possible combinations in drop table.

This behaviour feels very unintuitive and is definitely not how we want our lootbox system to work. So my question is, am I doing something wrong with my setup? If not, what would be a possible workaround for this?

Edit: After unlocking more chests, I notice that I sometimes get 3 drops instead of the "maximum" 4. I never got a number of items equal to the Quantity value I've set in Container's content.

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

·
JayZuo avatar image
JayZuo answered

I can't reproduce your issue. For testing purpose, I created a drop table named "DT1" like

And a container named "DT1Container", which has 4 "DT1".

Then I give this container to a player, now this player's inventory is like the following:

"Inventory": [
    {
        "ItemId": "DT1Container",
        "ItemInstanceId": "BFA5F1312CCF96DF",
        "PurchaseDate": "2019-01-18T07:30:34.877Z"
        "RemainingUses": 1,
        "Annotation": "Give a DT1Container for test",
        "CatalogVersion": "CatalogV1",
        "UnitPrice": 0
    },
    {
        "ItemId": "MediumHealthPotion",
        "ItemInstanceId": "38362D117D30B7E8",
        "PurchaseDate": "2019-01-18T07:13:37.723Z"
        "RemainingUses": 6,
        "Annotation": "Unlocked Crate",
        "CatalogVersion": "CatalogV1",
        "DisplayName": "Medium Health Potion",
        "UnitPrice": 0
    },
    {
        "ItemId": "HealthPotion",
        "ItemInstanceId": "FD8759CEFC0CAAE1",
        "PurchaseDate": "2019-01-18T07:13:37.692Z"
        "RemainingUses": 6,
        "Annotation": "Unlocked Crate",
        "CatalogVersion": "CatalogV1",
        "DisplayName": "Health Potion",
        "UnitPrice": 0
    }
],

Please note, now the player has 6 "MediumHealthPotion" and 6 "HealthPotion". Then I unlock this container with UnlockContainerItem.

And the response is

{
    "code": 200,
    "status": "OK",
    "data": {
        "UnlockedItemInstanceId": "BFA5F1312CCF96DF",
        "GrantedItems": [
            {
                "ItemId": "HealthPotion",
                "ItemInstanceId": "FD8759CEFC0CAAE1",
                "PurchaseDate": "2019-01-18T07:13:37.692Z",
                "RemainingUses": 10,
                "UsesIncrementedBy": 4,
                "Annotation": "Unlocked Crate",
                "CatalogVersion": "CatalogV1",
                "DisplayName": "Health Potion",
                "UnitPrice": 0
            }
        ]
    }
}

As you can see now the player has 10 "HealthPotion", "DT1Container" gives 4 "HealthPotion".

I'd suggest you recheck the response of UnlockContainerItem to see if your container granted right amount of items when unlocking. Using Postman might be a quick way. If you still have this issue, please share your Title Id and the Player Id you used to test.


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.

Canberk Soner avatar image Canberk Soner commented ·

Oooh, "UsesIncrementedBy":4 in the response, got it.

I had assumed that each drop would be a separate iteminstance object in GrantedItems, but thanks to your answer I noticed that there is the field "UsesIncrementedBy" so there are no duplicate objects in the array.

I didn't notice the response details because I have to call my container unlock unlocks from cloudscript accompanied by some custom logic.

Thanks for the help.

0 Likes 0 ·
JayZuo avatar image JayZuo ♦ Canberk Soner commented ·

Yeah, this is because my "HealthPotion" is stackable, if it's not stackable, then there will still be 4 "HealthPotion" item in GrantedItems one by one.

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.