Sign In Register

How can we help you today?

Start a new topic
Answered

Virtual Goods pack

Hello,


We want to allow players to buy:

  • pack of 1 itemX with price p1
  • pack of 3 itemX with price p2
  • pack of 6 itemX with price p3

Buying any of these packs should increase number n of itemX in players profile (goods: { itemX: n }).

We do not see from documentation about virtual goods that we can achieve that using existing gamesparks cc sdk.

Is this the case and should we custom code solution for this in cc?
 
If not, how to achieve this?

Best Regards,
Sasha



Best Answer

Hi Sasha,


There shouldn't be any need for you to use custom cloud code, you should be able to implement this using Bundled Goods:


1. Create your 'itemX' Virtual Good as normal.

2. Create a Virtual Good for each of your 'packs', specifying an amount of 'itemX' in it's Bundled Goods:


Now, when the player is awarded the 'packA' virtual good, they will also be awarded the bundled goods associated with it.


Try this out and let us know how it works for you.


Regards,

Vinnie



Answer

Hi Sasha,


There shouldn't be any need for you to use custom cloud code, you should be able to implement this using Bundled Goods:


1. Create your 'itemX' Virtual Good as normal.

2. Create a Virtual Good for each of your 'packs', specifying an amount of 'itemX' in it's Bundled Goods:


Now, when the player is awarded the 'packA' virtual good, they will also be awarded the bundled goods associated with it.


Try this out and let us know how it works for you.


Regards,

Vinnie


Hi, 


I just finished trying just that. What I do not like about this is that goods collection looks like  "goods: { itemX: n, packA: 1}" in stead of only "goods: { itemX: n }". 


Is there no way around this?


Best Regards,

Sasha

Hello,


I found a way around this. 


After calling BuyVirtualGoodsRequest to buy items package (PackA) I call ConsumeVirtualGoodRequest for PackA. Then PackA is removed from goods and only items from package remain. 


It's not nice but it works!


Thanks.


Sasha

Login to post a comment