question

aho avatar image
aho asked

character_inventory_item_added "InstanceID" vs. "ItemInstanceID",character_inventory_item_added "InstanceID" vs. "ItemInstanceID"? ItemInstanceID uniqueness?

Hi,

I've noticed that the character_inventory_item_added Playstream event gives an InstanceID that is not always the ItemInstanceID of the item at rest.

Given a consumable with charges remaining, or that has been consumed to 0, if I grant an item through the Game Manager I will get a new InstanceID that doesn't match up with the existing ItemInstanceID (the granted item is simply added to the existing stack, even if the current stack size = 0). InstanceID matches ItemInstanceID if it is an item that the player has never owned (or has been revoked through the Game Manager). What happens to the non-matching InstanceIDs? How should I think about them?

Also, could you please describe the uniqueness of ItemInstanceID? I apologize if this is answered somewhere, but I wasn't able to find a complete description on the forums in my initial search. Is ItemInstanceID unique across current ids? All ids that have ever existed (including the InstanceIDs that don't seem to go anywhere from above)? Unique on the Title level? etc.

Thanks!

,

Hi,

I've noticed that the character_inventory_item_added Playstream event gives an InstanceID that is not always the ItemInstanceID of the item at rest.

Given a consumable with charges remaining, or that has been consumed to 0, if I grant an item through the Game Manager I will get a new InstanceID that doesn't match up with the existing ItemInstanceID (the granted item is simply added to the existing stack, even if the current stack size = 0). InstanceID matches ItemInstanceID if it is an item that the player has never owned (or has been revoked through the Game Manager). What happens to the non-matching InstanceIDs? How should I think about them?

Also, could you please describe the uniqueness of ItemInstanceID? I apologize if this is answered somewhere, but I wasn't able to find a complete description on the forums in my initial search. Is ItemInstanceID unique across current ids? All ids that have ever existed (including the InstanceIDs that don't seem to go anywhere from above)? Unique on the Title level? etc.

Thanks!

Player Inventory
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.

aho avatar image aho commented ·

sorry for the double post - my post got cleared from the text box after logging in and I thought it was wiped

0 Likes 0 ·
brendan avatar image
brendan answered

My apologies - I do see that you were asking about events. You are correct - the event specifically gives the Instance ID (which is reliably unique) for the item which was added. In the case of stackable items, that instance will not appear in the player/character inventory if there's already one of it in that inventory, as the item added gets stacked onto that item. The event provides the specifics of what was added rather than the inventory state though - so, the event states that an item was added, while the return from the API call tells you the new state of the inventory. Two different purposes, effectively.

Does this cause an issue for you, in terms of using the data? If so, can you let us know what the issue is?

10 |1200

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

brendan avatar image
brendan answered

I'm afraid I don't understand the question. Could you clarify? When I test granting a stackable item to a user or character, whether via the Game Manager or the API calls, the resultant ItemInstanceId is consistent - a new stack on the user gets a unique ID, while a new stack granted to the character gets a unique ID. Any of the same item added to either the user or the character gets added to the existing stack, and that's the ItemInstanceId reported by the response to the API call.

10 |1200

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

aho avatar image
aho answered

in the Playstream event "character_inventory_item_added" there is a field called "InstanceID" - if it's a new stack "InstanceID" = ItemInstanceID, but when it's adding to an existing stack it seems like InstanceID is being thrown away

In general I'm looking for some more guidance on the uniqueness of ItemInstanceID (eg: if I search for an ItemInstanceID through the history of all transactions in my game, is that guaranteed to be unique or is it best effort unique?)

Thanks!

10 |1200

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

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.