Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by frozenvortexgames · Mar 04, 2017 at 07:22 AM · CloudScriptIn-Game Economy

Changing the price of an item using CloudScript?

Hi there,

I soon plan to create a "Stock Market" of sorts for my game, using PlayFab.

I want to do this by creating a catalog, containing 10-15 different stocks for "companies". Each will have their own stock value etc...

The player will be able to buy items from this catalog, effectively buying a stock.

I would like to know if it's possible to change the price of items via cloud script, so that we can have each item in this catalog change price every hour or so.

The value that the stock changed by would be random, using something like Random.Range to determine the exact "Random change" value that the stock will be effected by.

Would a feature like this be plausible?

If not have you any idea how I could achieve this?

Thanks!

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Mar 04, 2017 at 11:35 PM

The catalog for a game, like title data, is sharded and cached, so that it can be read by all users. So one issue is that when a change is made to a catalog version, it will take a short period for those changes to propagate to all shards, during which time different users may get different prices. So part of the answer here is to ask how reliable does the pricing need to be across all users? If it has to be precise, your best bet would be to set up an external query server that manages the stock prices, and which you query from the client or Cloud Script. If it's okay for players to get different prices during that "overlap" period when the prices are being changed, then you could drive the prices via Title Data, updating it using a Scheduled Task and making the purchases via Cloud Script. We don't currently provide a way to update the catalog via Cloud Script, though we do plan to expand the scheduled task capabilities with more of the Admin API in a future update.

Comment
frozenvortexgames

People who like this

1 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    1 Person is following this question.

    avatar image

    Related Questions

    Time Locked Items 3 Answers

    How to get contents from DropTable trough Client API? 1 Answer

    Subscriptions in PLayfab... 1 Answer

    Communication with external payment server 1 Answer

    Granting a Bundle creates an ItemInstance of the Bundle? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges