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.
Mementino Labs
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...
then the response is...
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