question

Muhammad Qasim avatar image
Muhammad Qasim asked

GetCharacterData is not working properly ?

GetCharacterData is working when I update the data from client but it is not working when I am setting data from playfab catalog item [returns nothing].

Detail:
I am using these catalog items as my characters/vehicles and then these vehicles have properties like speed, brake, steer etc which I am saving during item creation in catalog.

What could be the possible issue, Thanks.

....

What I was thinking is that the data may be private, but their is no option to make it public in dashboard.

dataCharacter DataCharacters
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

Can you clarify your flow and your expectations? Character data is data specific to a character. It has nothing whatsoever to do with the catalog or inventory items. If you mean you're updating custom data on an item in the catalog, can you clarify what your expectations are? The custom data on the items in the catalog is just that - at the catalog level. It's there so that it can be used as global settings, common to all players/characters, and it is always read from the catalog.

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.

Muhammad Qasim avatar image Muhammad Qasim commented ·

I have 4 vehicles and they have their specific properties such as speed, steer, color, rim etc

What I want is these value should be loaded from server and every vehicle should have their own property value.

What I have done is,
I have created a catalog of these 4 cars and set flag for character to true, also I have set their price and the above mentioned properties value in the custom field data.

After that,
I have bought a car and granted its access to the specific user, everything is working fine but when I get the character's custom data by passing character id using GetCharacterData() it doesn't returning me anything, in this case.
But

when I update these custom fields by using UpdateCharacterData() then it is getting the data by GetCharacterData().

So,
Should I have to get the custom data from the catalog and update it to the character/vehicle when I am granting access to it or their is any other simple solution ?

Thanks.

0 Likes 0 ·
brendan avatar image brendan Muhammad Qasim commented ·

I think there's a disconnect in the way you're using "token for character" in the catalog. By checking that option, you're saying that the inventory item is a token which can be exchanged for a character, using https://api.playfab.com/documentation/client/method/GrantCharacterToUser. An inventory item on its own is not a character.

It sounds like what you want to do is this:

1. Put the default values for speed, etc., in the catalog's custom data. Read the catalog to get those values.

2. Put any override for those values on the custom data of the inventory item instance.

There's no need to use the character system to accomplish this.

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.