Idea

contact-18 avatar image
contact-18 suggested

Economy v2: Sell Inventory Items like Purchase Inventory Items (or Exchange Inventory Item)

Is there a reason why there are no Sell Inventory Items?

It would be very helpful if you could store a sell price in the item. The call should then remove the item from the player inventory and give the player the stored currency.

Probably, a exchagen function would be even better:

Exchange Inventory Item

It would be cool if an item gets an exchange area. Here you can specify items that are needed to make an exchange. Exchange Items: 3x Item A 5x Item B

Exchange Result: 1x Item C

Player Inventory
10 |1200

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

2 Comments

·
kylemc@microsoft.com avatar image
kylemc@microsoft.com commented

I can think of two ways to do this with the current API.

  1. If you want to sell an item for the same price it was purchased
    1. Use the existing CatalogItem.PriceOptions on the item

    2. Write an Azure CloudScript Function that handles a sell request

    3. By calling ExecuteInventoryOperations to subtract the item and add the currency

  2. If you want to sell an item for a different price
    1. Put PriceOptions somewhere in your CatalogItem.DisplayProperties

    2. Same as 1.2

    3. Same as 1.3

There's maybe a third version where you write business logic based on InventoryItem.DisplayProperties in your CloudScript. For example, "if Item.DisplayProperties['IsRare'] then increase price by 1.3x". Would any of these options work for you?

10 |1200

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

contact-18 avatar image
contact-18 commented

hey thanks for the answer. i am currently trying to solve it via azur functions

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 a Comment

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

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.