Is there a way to access properties and property set in realtime scripts ?
My goal is to be able to AB tests some gameplay values (via segments).
Thanks for your help !
Best Answer
C
Customer Support
said
over 5 years ago
Hey Simon,
There is no direct access to the Spark API from the RT scripts. However you can preform a request out to your GameSparks config and get the response in your RT script and use that.
So, what i'd recommend is to create a logeventrequest which would use the Spark API to get the property set you need. The API can be found here. Then from the RTscript you call the logeventrequest to get the property sets you need. You can see examples of how that is done here.
I'd recommend doing this in the initial setup rather than doing it in a packet callback, as it'll take some time to send the request and get the response back. In the meantime it'll holdup packets coming in.
Let us know if you have any other problems. Thanks, Sean
1 Comment
Customer Support
said
over 5 years ago
Answer
Hey Simon,
There is no direct access to the Spark API from the RT scripts. However you can preform a request out to your GameSparks config and get the response in your RT script and use that.
So, what i'd recommend is to create a logeventrequest which would use the Spark API to get the property set you need. The API can be found here. Then from the RTscript you call the logeventrequest to get the property sets you need. You can see examples of how that is done here.
I'd recommend doing this in the initial setup rather than doing it in a packet callback, as it'll take some time to send the request and get the response back. In the meantime it'll holdup packets coming in.
Let us know if you have any other problems. Thanks, Sean
Simon Flandre
Hello,
Is there a way to access properties and property set in realtime scripts ?
My goal is to be able to AB tests some gameplay values (via segments).
Thanks for your help !
Hey Simon,
There is no direct access to the Spark API from the RT scripts.
However you can preform a request out to your GameSparks config and get the response in your RT script and use that.
So, what i'd recommend is to create a logeventrequest which would use the Spark API to get the property set you need. The API can be found here.
Then from the RTscript you call the logeventrequest to get the property sets you need. You can see examples of how that is done here.
I'd recommend doing this in the initial setup rather than doing it in a packet callback, as it'll take some time to send the request and get the response back. In the meantime it'll holdup packets coming in.
Let us know if you have any other problems.
Thanks,
Sean
Customer Support
Hey Simon,
There is no direct access to the Spark API from the RT scripts.
However you can preform a request out to your GameSparks config and get the response in your RT script and use that.
So, what i'd recommend is to create a logeventrequest which would use the Spark API to get the property set you need. The API can be found here.
Then from the RTscript you call the logeventrequest to get the property sets you need. You can see examples of how that is done here.
I'd recommend doing this in the initial setup rather than doing it in a packet callback, as it'll take some time to send the request and get the response back. In the meantime it'll holdup packets coming in.
Let us know if you have any other problems.
Thanks,
Sean
-
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