question

Kain avatar image
Kain asked

What happens when an Item is deleted from a Catalog?

Hello,

If we were delete an item from a catalog that exists in Player/Character inventory, would the missing item be gracefully handled as if the item never existed?

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

1 Answer

·
brendan avatar image
brendan answered

It depends upon the item. For most items, that would be fine, as there's no need to look anything up. Containers, however, need to be able to look up their catalog info to figure out what they should be delivering to the user when they are opened.

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.

lanpartygamesstudio avatar image lanpartygamesstudio commented ·

Currently when I delete an Item (not a Container) from the Catalog, all the item instances on players inventories just stay there.

Is this the expected behavior?

If I want to just completely remove the item from the game (and all inventories), how should I go about it? IMO this functionality specially something desirable during development...

Thanks!

0 Likes 0 ·
brendan avatar image brendan lanpartygamesstudio commented ·

Yes, that is the expected behavior. Changes to the catalog do not affect pre-existing item instances that players have.

If you need to remove an item from all players, I'd recommend using an "OnLogin" Cloud Script handler as part of your logic. That way, you can check for things that need to be cleaned up on the player account when the client logs in. You'll want to make sure to limit that logic, so that you don't exceed the Cloud Script API/time limits though, so progressive cleanup over multiple game session is sometimes the right way to go.

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.