question

Game Developer avatar image
Game Developer asked

is it possible to set a local variable as a value of a variable in a cloudscript

hi im new to playfab and currently developing a game. is it possible for me to manipulate a variable in acloudscrip and do mathematical equations with it. what i am planning is that the player would reach a certain point where his score multiplier (which is a cloudscript variable) would increase every checkpoint where the score multiplier will do mathematical equations inside the cloudscript with the score. is it possible to do this kind of things @Brendan

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.

Game Developer avatar image Game Developer commented ·

is it also possible to make a cloudscript variable be the value of a local variable in game

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

The script itself is static code, and runs stateless, so each time the client runs a Cloud Script, you should assume it has no information from any previous executions. You can get data for processing in the script several ways:

  • Pass it in from the client as arguments
  • Read player data from the service
  • Read Title Data from the service (note: never attempt to update Title Data based on a client action - that is not supported and will not work)
  • Read data from an external table, like a Redis cache
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.