Sign In Register

How can we help you today?

Start a new topic

How to edit/change/modify Response


I'm playing around with Bundled Virtual Goods and I want to:

1. Discount a bundle price if player already owns an included item.

I'm creating a Cloud Code Script on ListVirtualGoodsResponse.
I already have working logic to calculate new price by discounting owned item(s) on each bundle.

What I can't do is to modify the original VGood price (in the response)...

If I do...

Spark.setScriptData("virtualGoods", vGoods);


then the response is...    

   "scriptData" : { "virtualGoods" : [...] },       // <== modified list
   "virtualGoods" [...]                             // <== old list


What I want is to replace entirely the virtualGoods list.

Is this possible?

Another solution I see (but don't like) is to send the discount info in the scriptData, and the client does the math. But I don't want to give power to the client.

2 people have this question
1 Comment


I have the same kind of question...

Do you find a way to do that ?



Login to post a comment