question

Name avatar image
Name asked

Optimal way to add multiple currencies and items with CloudScript without bundles or drop tables.

Hi, it's possible to add multiple currencies at one request?

And is it also possible add stacked items with amount?

For example, i finished a level and want to add: 100 soft currency, 10 hard currency, 5 stackable item of one type, and 3 diffrent non stackable items with diffrent types. And it's all random currency and items count and types, define by local client drop logic, so i can't use predefine bundle or drop tables.

And for this example, how can i add hard and soft currency in one api call?

For items shoud i use GrantItemsToUser with ItemIds [stack_item, stack_item, stack_item, stack_item, stack_item, item_1, item_2, item_3]?

It's possible to add stack items with their amount, do not list them all?

It's better to use ModifyItemUses for stacked items? But for this case should i check if the item exists in the inventory?

And the last question, is it a good idea to use stacking items for something we get and spend a lot (item upgrade scrolls) or is it better to use virtual currency?

For this logic i use CloudScript.

,

Hi, it's possible to add multiple currencies at one request?

And is it also possible add stacked items with amount?

For example, i finished a level and want to add: 100 soft currency, 10 hard currency, 5 stackable item of one type, and 3 diffrent non stackable items with diffrent types. And it's all random currency and items count and types, define by local client drop logic, so i can't use predefine bundle or drop tables.

And for this example, how can i add hard and soft currency in one api call?

For items shoud i use GrantItemsToUser with ItemIds [stack_item, stack_item, stack_item, stack_item, stack_item, item_1, item_2, item_3]?

It's possible to add stack items with their amount, do not list them all?

It's better to use ModifyItemUses for stacked items? But for this case should i check if the item exists in the inventory?

And the last question, is it a good idea to use stacking items for something we get and spend a lot (item upgrade scrolls) or is it better to use virtual currency?

For this logic i use CloudScript.

apisCloudScriptIn-Game Economy
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

>>it's possible to add multiple currencies at one request?

Sorry, no, each API call can only modify one currency type, you’d need separate calls to deal with multiple currencies.

>>It's possible to add stack items with their amount, do not list them all? It's better to use ModifyItemUses for stacked items? But for this case should i check if the item exists in the inventory?

Yes, using ModifyItemUses is much simpler when there is a large number of stackable items need to be added. And, you should check whether the item exists in the inventory before modify its uses since the ModifyItemUses API requires the ItemInstanceId of the item in the inventory.

>> And the last question, is it a good idea to use stacking items for something we get and spend a lot (item upgrade scrolls) or is it better to use virtual currency?

Virtual Currency seems much simpler when handling this logic, and, you can also consider using Statistics for this.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]