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?