Hi!
In my Unity Project I have a Deck Builder Scene where all cards get loaded in. The cards are scriptable objects. If I want to add an economy system to my game and make cards unlockable in the Deck Builder, what would be the best approach to do that?
Since I have all the information about the cards such as values and illustrations etc. in the scriptable objects called Card Assets I am not exactly sure how to make it work with a Catalog.
I assume the best solution in my case would be to create Items in the Catalog with the same name as the Card Assets and then just compare the strings of the Card Assets and the item_ID. So all the items the player ones will be compared with my Card Assets and based on that I can load my card collection accordingly right? Then I could flag those who are found in the catalog as choosable for a deck for example.
Or are there any other / better solutions?
Thanks in advance!
Answer by SethDu · Jul 26, 2021 at 08:04 AM
I think you are on the right track. It is necessary to define each card as an item in the Catalog, and it is optional to set them stackable. The properties like “Class” and “Tags” can help categorize the cards. In this case, Inventory items will be the cards that a player owns.
Regarding a single card, you may define attributes in Custom Data, which is read-only for players and when GetCatalogItems API is called, all information of an item, including attributes will be returned in the callback. You may define a card class in your client to handle all the attributes.
When building the deck, the client will compare the whole catalog data with inventory items, you can dim those cards that the player doesn’t own (or simply hide them) and highlight the owned ones. The deck is a specific to a player, you can store the deck collection in Player Read-Only Data.
thanks for the quick response. I ll try things out and maybe come back if I have more questions about this topic.
Just to clarify, with "You may define a card class in your client to handle all the attributes." you mean handling all the card values within the game itself (unity - my scriptable objects) right?
And thanks for the inventory input, thats helps and is a good idea.
>>handling all the card values within the game itself
Yes. Please also note that Item Class has been defined in PlayFab SDK, you may direct refer to use it if it satisfies your requirement.