question

Rock Bolton avatar image
Rock Bolton asked

Grant Item to Character with Custom Data

Hi All!

Is there a way to grant an item to a character with custom data in a single API call?

Looking through the API docs, it would appear my best bet is to:
  1. Grant the Item to the Character
  2. Then Update the Inventory Item Custom using the first GrantedItemInstance (since I'm only granting 1 item) from the GrantItemsToCharacterResult

Just making sure I'm not missing a more appropriate API call to use!

Thanks!
-Rock

In-Game EconomyCharacters
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

The steps you mentioned are the most appropriate API calls. Besides, you can write the custom CloudScript functions to combine these API calls on the server-side. Then clients can execute the CloudScript function via client API ExecuteCloudScript.

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.

Rock Bolton avatar image Rock Bolton commented ·

Awesome! Thank you for the response! CloudScripts are great, but I might have to stick Server API calls for this particular solution. Currently making a vending machine that players can buy weapons from (similar to borderlands) but the items available are generated server-side so clients can't potentially create broken/over-powered items to buy.

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.