question

William Caine avatar image
William Caine asked

Legacy inventory stackable not reporting correct remaining uses

I am trying to understand if there is a bug with the legacy inventory stackables. My stackable item I would assume would roll up the items uses total to the Active but its not doing that in this example. Bug? Or am I using it wrong?

6656-stacked-raffle-tickets-acting-wierd-a.png

apisPlayer Inventory
10 |1200

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

Neils Shi avatar image
Neils Shi answered

Assume that you grant 5 items to the player:

6667-item1.png

And then consume 3 items (for example calling the API ConsumeItem), now there are only 2 remaining usages left. At this point, Game Manager’s player inventory will show that there are 2 active status items and 4 stacked items.

6649-item2.png

That’s why the total stacked items are not match the remaining usage. And since the API GetUserInventory only retrieve the items in the player's inventory that in active status, then the result of "RemainingUses" is 2.


item1.png (55.3 KiB)
item2.png (42.6 KiB)
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.

William Caine avatar image William Caine commented ·

Thanks for the reply. I’ll am still confused. Using your screen shots. I see no difference between the first and second other than the active item remaining “uses left” changed. How can I tell which of the stacked items have been consumed in the second screen shot? All of them still report “uses left”:1 but I would assume some would remove 0 when consumed @Neils Shi

0 Likes 0 ·
Neils Shi avatar image Neils Shi William Caine commented ·

How can I tell which of the stacked items have been consumed in the second screen shot?

The amount of items consumed by the player will only be reflected in the "use left" change of the active items. And you have no way of knowing which stacked items are consumed.

All of them still report “uses left”:1 but I would assume some would remove 0 when consumed.

Please note that players can only consume items which in active status. And after player consumes the items, only the "use left" of the active item changes, the rest of the stacked items keep 1 "use left".

0 Likes 0 ·
Neils Shi avatar image
Neils Shi answered

Please note that the API GetUserInventory only retrieve the items in the player's inventory that in active status. And if you grant multiple stackable items to user, each item will have their own item instance id. And then, except for the first granted item, other items will be transferred to Stacked status, and the total remaining usage will be added to the first granted item. This is how the items are stacked.

1 comment
10 |1200

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

William Caine avatar image William Caine commented ·

@Neils Shi I agree with you in that is how it suppose to work. But if you look at my screen shot the count returned is not the aggregate sum but only the active count.

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.