Sign In Register

How can we help you today?

Start a new topic

How to edit/change/modify Response

Hello,

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

Hello!


I have the same kind of question...


https://support.gamesparks.net/support/discussions/topics/1000091438


Do you find a way to do that ?



Regards


Diego

Login to post a comment