Sign In Register

How can we help you today?

Start a new topic
Answered

Associate Challenge with Image

Hey, In my game i want players to be able to send challenge requests to other that include an image upload that the player accepting the challenge will download.
So the challenge itself is sending a painted image to other players.


I know how to send a challenge and upload an image but how do i associate them together ? cloud script ? other way ?




Best Answer
Okay, so if you have the id/shortCode of your uploadable, you can include it in the message you are going to send with the CreateChallengeRequest. Then, each player who receives the message can separately get the image URL.

 This is actually the best option. The other way is to create a wrapper request that takes all the details you need to create a challenge including the uploadableID. You call a GetUploadablesRequest from that event and get the URL back. Then you call the CreateChallengeRequest from within that request (there is an example of that in the link above too) with the url included in the message.
Doing things this way means that the URL might not be valid by the time a player sees it, as the URL is only valid for 30mins.

Does that make sense?
Sean


Hey Aviv,

Where is your image uploaded to?

Sean

 

Hey Sean,


I'm using the Gamespraks GetUploadUrlRequest like in this example : Unity-Upload-images
so i the images are uploaded to the uploadedFiles System Collection.


Answer
Okay, so if you have the id/shortCode of your uploadable, you can include it in the message you are going to send with the CreateChallengeRequest. Then, each player who receives the message can separately get the image URL.

 This is actually the best option. The other way is to create a wrapper request that takes all the details you need to create a challenge including the uploadableID. You call a GetUploadablesRequest from that event and get the URL back. Then you call the CreateChallengeRequest from within that request (there is an example of that in the link above too) with the url included in the message.
Doing things this way means that the URL might not be valid by the time a player sees it, as the URL is only valid for 30mins.

Does that make sense?
Sean

Hey Sean, this dentally make sense.

When you say to include the upload id in the message with the Create Challenge request ,you mean to use the challengeMessage field for the upload id right ? 

Yep. You could add it in there. It could be useful to to do something like "Here is my Message%"+uploadID .... that way you could split the string to get the uploadID but also keep a challenge message to your opponents

 


1 person likes this

Great thank you for your help!

Login to post a comment