question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

Duplicated catalog usage

Hello everyone,

I will add new items to our game, but that will break the current version of the game (null reference issue). I didn't code the game that flexible unfortunately. The new version will have more items than the old one.

I duplicated the catalog in the game manager and added the new ones. The old one is called "Items" and the new is called "Items2". I can set one of them as the primary catalog. My questions are:

- What does primary catalog mean?

- If set one of them as primary catalog, can I still access the old one? The old version of the game will try to access the "Items" catalog by giving "CatalogVersion" parameter as "Items". The new version of the game will access the "Items2" catalog by giving "CatalogVersion" parameter as "Items2". Does that work without any issue? I don't want to break the game for the current players.

Here's the example code, the old version of the game will use this revision of the Cloudscript:

function GetItemByID(id) {
    var getItems = {
        "CatalogVersion": "Items"
    };
    var getItemsResult = server.GetCatalogItems(getItems);
    return getItemsResult.Catalog.find(x => x.ItemId == id);
}

The new version of the game will use this revision of the Cloudscript:

function GetItemByID(id) {
    var getItems = {
        "CatalogVersion": "Items2"
    };
    var getItemsResult = server.GetCatalogItems(getItems);
    return getItemsResult.Catalog.find(x => x.ItemId == id);
}

EDIT: I also want to ask what happens if I delete the old catalog afterwards? Will it affect the players' inventories?

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

·
Sarah Zhang avatar image
Sarah Zhang answered

Primary Catalog is like a default catalog version of your title. If you call the API GetCatalogItems and don’t provide a Catalog Version, the API will get the items of primary catalog. And if you want to integrate the in-app-purchase (IAP) with your game, only the items belong to the Primary Catalog can be set as the product you will sell in the third platform, like Google Play, Steam, etc.

Your code looks like can work fine. And please note the above two points.

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.

Ozan Yilmaz avatar image Ozan Yilmaz commented ·

What about the items in the players' inventories already? I'm thinking of deleting the catalog "Items" a week later releasing the new version of the game, which will use "Item2" catalog. As long as the same items are provided in "Items2", does it affect the players' inventories?

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.