question

eric@begoodi.fr avatar image
eric@begoodi.fr asked

Grant character problem

I have error 400 when trying to grant a character to a user.

- Item exists
- I manually override
- The item belongs to the user
- But the grant does not work (InvalidItemProperties)

Any Idea ?

Here is the body of GrantCharacterToUser :

{
"CatalogVersion": "MainCat",
"ItemId": "Player_Lionel",
"CharacterName": "Lionel"
}

Here is the JSON of the item :

{
"ItemId": "Player_Lionel",
"ItemClass": null,
"CatalogVersion": "MainCat",
"DisplayName": "Lionel",
"Description": null,
"VirtualCurrencyPrices": {
"HC": 10000
},
"RealCurrencyPrices": null,
"Tags": [],
"CustomData": "{\"Speed\":\"100\",\"Force\":\"100\",\"Endurance\":\"100\"}",
"Consumable": {
"UsageCount": null,
"UsagePeriod": null,
"UsagePeriodGroup": null
},
"Container": null,
"Bundle": null,
"CanBecomeCharacter": true,
"IsStackable": false,
"IsTradable": false,
"ItemImageUrl": null
}

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Can you provide the complete text of the error you're getting back? An InvalidProperties response should always contain an errorDetails which gives the specifics on the properties which are causing the problem.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

eric@begoodi.fr avatar image
eric@begoodi.fr answered

Hi Brendan,

 

Here is the return body :

{
"code": 400,
"status": "BadRequest",
"error": "InvalidItemProperties",
"errorCode": 1091,
"errorMessage": "InvalidItemProperties"
}

I succeeded doing it from server side. Perhaps it's not possible by the client, but as it was described in client APIs I thought it was possible...

 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

The problem in this case is that CanBecomeCharacter is not set for the inventory item. Bear in mind that properties for items (stackable, tradable, etc.) are set when the item is instanced into the player inventory. So if you changed the Catalog item to set CanBecomeCharacter after you'd already granted that item to the player, it wouldn't have set that flag on the instance in the player's inventory. Please make sure CanBecomeCharacter is set on the Catalog item and then grant a new instance of that item to the player (removing any old ones). That should resolve the issue.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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.