How to store player skill & how persistent is script data?
D
Damir Halilovic
started a topic
about 6 years ago
Heya,
I've been scratching my head a bit regarding player skill. Matchmaking requires me to pass through a skill level for the player, but you'd think this would be something tied to the player object not something I have to manually pass through. In Cloud Code, the getPlayer() object even has a skill variable, but it's not passed through with a AccountDetailsRequest.
My guess is that the skill variable in Cloud Code is populated via the skill passed in with a match making request... which means the player skill is something I have to store and manage on my own, which is perfectly fine.
Which brings me to my next question - how persisted is ScriptData? The documentation says that it persist through the lifetime of the player. Does this mean it's stored across session or is a lifetime just the session, after which the ScriptData gets destroyed?
Best regards,
Damir H.
Best Answer
T
Tech Support
said
about 6 years ago
Hey Damir,
player.scriptData is only ever removed manually. It stays persistent on the player's database. If you think of the player as an entry in a huge database named Players, then scriptData will be a JSON object in that entry. You can place data inside that object and it will stay there and can be retreived through cloud code or accountDetails request.
So it's not limited to sessions. It remains active as long as you dont remove it. There is also privateData which works exactly the same way but you can't retrieve it using accountDetails request, only through cloud code.
player.scriptData is only ever removed manually. It stays persistent on the player's database. If you think of the player as an entry in a huge database named Players, then scriptData will be a JSON object in that entry. You can place data inside that object and it will stay there and can be retreived through cloud code or accountDetails request.
So it's not limited to sessions. It remains active as long as you dont remove it. There is also privateData which works exactly the same way but you can't retrieve it using accountDetails request, only through cloud code.
Damir Halilovic
Heya,
I've been scratching my head a bit regarding player skill. Matchmaking requires me to pass through a skill level for the player, but you'd think this would be something tied to the player object not something I have to manually pass through. In Cloud Code, the getPlayer() object even has a skill variable, but it's not passed through with a AccountDetailsRequest.
My guess is that the skill variable in Cloud Code is populated via the skill passed in with a match making request... which means the player skill is something I have to store and manage on my own, which is perfectly fine.
Which brings me to my next question - how persisted is ScriptData? The documentation says that it persist through the lifetime of the player. Does this mean it's stored across session or is a lifetime just the session, after which the ScriptData gets destroyed?
Best regards,
Damir H.
Hey Damir,
player.scriptData is only ever removed manually. It stays persistent on the player's database. If you think of the player as an entry in a huge database named Players, then scriptData will be a JSON object in that entry. You can place data inside that object and it will stay there and can be retreived through cloud code or accountDetails request.
So it's not limited to sessions. It remains active as long as you dont remove it. There is also privateData which works exactly the same way but you can't retrieve it using accountDetails request, only through cloud code.
Hope this helps,
Omar
- Oldest First
- Popular
- Newest First
Sorted by PopularTech Support
Hey Damir,
player.scriptData is only ever removed manually. It stays persistent on the player's database. If you think of the player as an entry in a huge database named Players, then scriptData will be a JSON object in that entry. You can place data inside that object and it will stay there and can be retreived through cloud code or accountDetails request.
So it's not limited to sessions. It remains active as long as you dont remove it. There is also privateData which works exactly the same way but you can't retrieve it using accountDetails request, only through cloud code.
Hope this helps,
Omar
1 person likes this
Damir Halilovic
That is perfect, thank you very much.
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics