question

studiolumiere avatar image
studiolumiere asked

Recharge Currency Question

Is there any way to collect 100 currency when charging is successful? Currently, I think it increments by 1 per charge.

,

Is there any way to collect 100 currency when charging is successful?

Currently, I think it increments by 1 per charge.

10 |1200

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

Seth Du avatar image
Seth Du answered

Virtual Currency has recharge feature, and I suggest defining a specific VC for this requirement. You may set 100 for Recharge maximum and in terms of Recharge rate (units per day), it depends on your requirement. The value will be granted gradually within a day.

Regarding “collect” feature, you may implement a Cloud Script/Azure Function that will check the current value and grant the same value to another virtual currency, then reset to 0 via SubtractUserVirtualCurrency API call.

2 comments
10 |1200

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

studiolumiere avatar image studiolumiere commented ·

Let's reproduce the process in question.

(I'm not good at English, so please forgive me for using a translator.)

[Recharge]

Step 1. Create 2 goods (Energy1, Energy2)

Step 2. Set the Recharge rate (unit/day) of 'Energy1' to 144.

Step 3. After 10 minutes, if 'Energy1' increases by +1, increase 'Energy2' by +100 through the cloud script.

[Consumption]

Step 1. Consume 50 'Energy2'.

Step 2. Consume 'Energy1' (50/100 = 0.5) via cloud script.

In the process of consumption, I ran into a problem because the currency were integers.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ studiolumiere commented ·

Virtual Currency is integers. If you require decimal numbers, you may multiply the number by 10.

0 Likes 0 ·
studiolumiere avatar image
studiolumiere answered

For example, [ Recharge Rate : 144 ] 1 currency count per 10 minutes.

I want 100 currency count in 10 minutes. (It's not in increments of 1 to reach 100.)

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.