question

ariellarias avatar image
ariellarias asked

Task triggering CloudScript Question

Hi!

If I create a task that runs a Cloudscript at Given Event that a player triggers (a Custom Event), is it possible to retreive from that cloudscript handler the Body of data from the triggering event?

Thanks!

apisCloudScript
10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Yes, the details of the event that triggered the Rule are available in the context of the call to the handler in question. We'll have a more complete write-up available on this soon, but if you have a look at the handlePlayStreamEventAndProfile handler in the basic Cloud Script set up as Revision 1 in new titles, you'll see how to do this. In short, for a handler defined something like this:

handlers.handlePlayStreamEventAndProfile = function (args, context) {

...

}

You can access the parameters of the event that triggered the call using

context.playStreamEvent.EventName

context.playStreamEvent.EventId

etc.

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.

ariellarias avatar image ariellarias commented ·

Great! That's what I was looking for :D

0 Likes 0 ·

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.