question

lu.zhang@sectionstudios.com avatar image
lu.zhang@sectionstudios.com asked

How to let the server to call a Cloud Script every several days?

I want to let the server to change some of the variables which will affect all the players' game. Is there anyway to let the server call the Cloud Script function automatically every several days?

In addition, is there any way to store a "global" variable that every player can access?

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

Global variables can be stored in Title Data - that way, you could update it once, and all players would get the same value.

Cloud Script calls are triggered from player-directed actions. We'll be expanding the ways in which Cloud Script can be triggered in the near future, but actually, the best way to update values for all players is to have a handler in your Cloud Script which you call just after the player signs in, so that you can check what "version" of your game data he has, and update anything you need to. That way, players will naturally get the latest info when they sign in.

10 |1200

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

lu.zhang@sectionstudios.com avatar image
lu.zhang@sectionstudios.com answered

Thank you Brendanv. The question I am running into is that I want to keep the all the player under the same "climate", which will be changed randomly and automatically through time. So I hope I can have something keep running on the server and update the "climate" variable.

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

Ah, I see - so you're not looking for a Cron job across all players, but rather one that acts as your administrative agent for the game. That makes perfect sense, thanks. As I said, we will have additional ways to trigger Cloud Scripts in the near future - I'll add a work item to make sure we're considering the scenario you have in mind.

10 |1200

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

lu.zhang@sectionstudios.com avatar image
lu.zhang@sectionstudios.com answered

Thank you. I look forward to it.

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.