top of page

Virtual Currencies

The Virtual Currencies plugin is specifically designed to manage the application's virtual store, currency and user's side of economy and inventory through the PlayFab service, for games built using Construct 3 and Construct 2.


Interconnected with major platforms including Google Play, Game Center, Apple Login, Instant Games, Facebook, Facebook Instant Games, Steam, Xbox Live, Nintendo Switch, PS4 and of course PlayFab's own account system allows you to access the player's inventory, purchases, subscriptions, claims, redeem coupons, manage virtual currencies and other transactions.


The economy, store list, catalog items, virtual currencies, and user's inventory and transaction data are accessible through the PlayFab Console.


Use this PlayFab plugin to manage and create your user's inventory, purchases, subscriptions and other store or inventory transactions.

PlayFab API v2.png

Introduction

Step 1.png

The Construct Master Collection supports the full and easy integration of the PlayFab service for both Construct 3 and Construct 2.


Please click here to learn more about PlayFab.

Features


Here are some of the features of the PlayFab service:

  • Purchases

  • Subscriptions

  • Advanced purchases

  • Advanced subscriptions

  • Redeem Codes

  • User inventory

  • Consume products or items

  • Bundles

  • Containers

  • Drop Tables

  • Stores

  • User virtual currencies


For more information about all the integrated PlayFab service features, please click here to learn the introductory lessons to PlayFab.


Network Services


Here are some of the platform services that can be linked:

  • PlayFab

  • Google Play

  • Game Center

  • Facebook

  • Facebook Instant Games

  • Steam

  • Xbox Live

  • Instant Games (Android Studio port)

  • Nintendo Switch (3rd party porting services)

  • PS4 (3rd party porting services)

  • Nintendo Switch (3rd party porting services)


Editor Features


Here are some of the features in the Construct editor:

  • All platforms support, including web, mobile and desktop.

  • Construct 3

  • Construct 2

Introduction
Features

How to use?

It is easy to use the Virtual Currencies plugin, you will only need to follow the steps below.

  1. Set up the PlayFab API plugin, please click to visit the documentation. This includes creating a PlayFab account, studio and title.

  2. Set up the Authentication plugin, please click to visit the documentation.

  3. Finally, you can now use the Virtual Currencies object, and include more PlayFab addons for more features.


Instructions
Documentation

Documentation

There is currently nothing to show, we will add more in the future.



Server Configuration


The Virtual Currencies with PlayFab is implemented by creating catalogs, store lists and virtual currencies for store trade and other transactions. It is easy to set in the PlayFab console.



Step 1 : From the PlayFab Dashboard, select the Economy menu option. By default, the Catalog tab will initially show.

Step 2 : Click the New Catalog button, then fill up the configuration form.



Step 3 : Once the catalog is created, press the New Item button.

Step 4 : An item creation configuration form will launch, fill the necessary settings configuration for the new item.



Step 5 : Once your catalogs are set, you will need to configure your virtual currencies. Now, click the Currency tab. ​ Step 6 : Finally, add and configure your new virtual currency that will be used in your application's virtual store.



Virtual Currencies


To allow Construct 3 or Construct 2's event sheet system to add or subtract virtual currencies, you need to enable the API features in your PlayFab title settings.

  1. Login to your PlayFab account.

  2. Choose a studio and select the title you want to enable adding and/or subtracting virtual currencies.

  3. From the sidebar, select the settings icon.

  4. Then, click the Title Settings option.

  5. From the Title Settings page, select the API features tab.

  6. Under the Enable API Features section, check the following checkboxes.

    • Allow client to add virtual currency

    • Allow client to subtract virtual currency


Once you are finished with your PlayFab console server configuration, including the virtual currencies setup. You should now be able to use the Virtual Currencies plugin in your game application project.



Related Plugins


ACEs

Actions, Conditions & Expressions

Actions

The following action groups:

  • Virtual Currency

  • Item Management

  • Reward Management

Virtual Currency

  • Add User Currency - Increments the user's balance of the specified virtual currency by the stated amount.

    • Virtual Currency - Name of the virtual currency which is to be incremented.

    • Amount - Amount to be added to the user balance of the specified virtual currency.

    • Tag - The tag to differentiate requests.


  • Subtract User Currency - Decrements the user's balance of the specified virtual currency by the stated amount. A Negative Balance is possible.

    • Virtual Currency - Name of the virtual currency which is to be decremented.

    • Amount - Amount to be subtracted from the user balance of the specified virtual currency.

    • Tag - The tag to differentiate requests.



Item Management

  • Get User Inventory - Retrieves the user's current inventory of virtual goods.

    • Tag - The tag to differentiate requests.​​


  • Consume Item - Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory.

    • Item Instance ID - Unique instance identifier of the item to be consumed.

    • Consume Count - Number of uses to consume from the item.


  • Purchase Item - Buys a single item with virtual currency.

    • Item ID - Unique identifier of the item to purchase.

    • Price - Price the client expects to pay for the item (in case a new catalog or store was uploaded, with new prices).

    • Virtual Currency - Virtual currency to use to purchase the item.


  • Advanced Purchase Item - Buys a single item with virtual currency. Using advanced features.

    • Item ID - Unique identifier of the item to purchase.

    • Price - Price the client expects to pay for the item (in case a new catalog or store was uploaded, with new prices).

    • Store ID - Store to buy this item through. If not set, prices default to those in the catalog.

    • Virtual Currency - Virtual currency to use to purchase the item.

    • Catalog - Catalog version for the items to be purchased (defaults to most recent version.

    • Catalog Version - Specific Catalog version for the items to be purchased.


Reward Management

  • Redeem Coupon - Adds the virtual goods associated with the coupon to the user's inventory.

    • Coupon Code - Generated coupon code to redeem.

    • Tag - The tag to differentiate requests.​


  • Redeem Coupon by Version - Adds the virtual goods associated with the coupon to the user's inventory. With Specify the Catalog Version.

    • Coupon Code - Generated coupon code to redeem.

    • Catalog Version - Catalog version of the coupon.

    • Tag - The tag to differentiate requests.​

Conditions

The following condition groups:

  • Virtual Currency

  • Get User Inventory

  • Consume Item

  • Purchase Item

  • Redeem Coupon

Virtual Currency

  • On Add User Currency - Triggers when the On Add User Virtual Currency Succeeded.


  • On Add User Currency Error - Triggers when the On Add User Virtual Currency Failed.


  • On Subtract User Currency - Triggers when the On Subtract User Virtual Currency Succeeded.


  • On Subtract User Currency Error - Triggers when the On Subtract User Virtual Currency Failed.


Get User Inventory

  • On Get User Inventory - Triggers when the On Get User Inventory Succeeded.


  • On Get User Inventory Error - Triggers when the On Get User Inventory Failed.


  • For Each Inventory - Loops through the "Inventory List" if "On Get User Inventory" is successful.


Consume Item

  • On Consume Success - Triggers when the On Consume Item Succeeded.


  • On Consume Error - Triggers when the On Consume Item Failed.


Purchase Item

  • On Purchase Success - Triggers when the On Purchase Item Succeeded.


  • On Purchase Error - Triggers when the On Purchase Item Failed.


Redeem Coupon

  • On Redeem Success - Triggers when the On Redeem Coupon Succeeded.


  • On Redeem Error - Triggers when the On Redeem Coupon Failed.


  • On Coupon Already Redeemed - Triggers when the Coupon Code is already redeemed.


  • On Coupon Code Not Found - Triggers when the Coupon Code is not found.


  • For Each Received - Loops through the "Granted Items List" if "On Redeem Coupon" is successful.

Expressions

The following expression groups:

  • Consume Item

  • Purchase Item

  • Get User Inventory : Inventory

  • Get User Inventory : Virtual Currency

  • Redeem Code

  • Add User Virtual Currency

  • Subtract User Virtual Currency

  • Server Response

  • Request

Consume Item

  • conItemInstanceID - Returns the "Item Instance ID". Unique instance identifier of the item with uses consumed.


  • conRemainingUses - Returns the "Remaining Uses". Number of uses remaining on the item.



Purchase Item

  • purItemID - Returns the "Item ID". Unique identifier for the inventory item, as defined in the catalog.


  • purItemInstanceID - Returns the "Item Instance ID". Unique item identifier for this specific instance of the item.


  • purDate - Returns the "Purchase Date". Timestamp for when this instance was purchased.


  • purCatalogVersion - Returns the "Catalog Version". Catalog version for the inventory item, when this instance was created.


  • purDisplayName - Returns the "Display Name". CatalogItem.DisplayName at the time this item was purchased.


  • purCustomData - Returns the "Custom Data" in JSON string. The custom data of the item upon purchase.


  • purGetCustomData - Returns the "Custom Data" value from a key. The custom data of the item upon purchase.

    • Key​ - The key to get the value from the custom data.


  • purCurrency - Returns the "Unit Currency". Currency type for the cost of the catalog item.


  • purPrice - Returns the "Unit Price". Cost of the catalog item in the given currency.


  • purBundleParent - Returns the "Bundle Parent". Unique identifier for the parent inventory item, as defined in the catalog, for object which were added from a bundle or container.


  • purBundleContent - Returns the "Bundle Content" from an index. Unique items that were awarded when this catalog item was purchased.


  • purBundleContentCount - Returns the "Bundle Content Count". The number of bundle content awarded.


Get User Inventory : Inventory

  • curItemID - Returns the "Item ID". Unique identifier for the inventory item, as defined in the catalog.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • curItemInstanceID - Returns the "Item Instance ID". Unique item identifier for this specific instance of the item.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • curItemClass - Returns the "Item Class". Class name for the inventory item, as defined in the catalog.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • curCatalogVersion - Returns the "Catalog Version" for the inventory item, when this instance was created.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • curPrice - Returns the "Unit Price". Cost of the catalog item in the given currency.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • curCurrency - Returns the "Unit Currency". Currency type for the cost of the catalog item.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • curRemainingUses - Returns the "Remaining Uses". Total number of remaining uses, if this is a consumable item.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • curDisplayName - Returns the "Display Name". CatalogItem.DisplayName at the time this item was purchased.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • curCustomData - Returns the "Custom Data" in JSON string. The custom data of the item upon claim.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • curGetCustomData - Returns the "Custom Data" value from a key. The custom data of the item upon claim.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".

    • Key - The key to get the value from the custom data.


  • curExpiration - Returns the "Expiration". Timestamp for when this instance will expire.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • curPurchaseDate - Returns the "Purchase Date". Timestamp for when this instance was purchased.

    • Index - The Index to lookup from the Inventory. Collected from the latest "Get User Inventory".


  • loopInventory - The LoopIndex from the "For Each Inventory" through the Array of inventory items belonging to the user.​


  • countInventory - The Inventory Count from the Array of inventory items belonging to the user.


Get User Inventory : Virtual Currency

  • retCurrencyVal - Returns the "Currency Value". Value of the "Currency" that was inputted.

    • "" - The Currency to load from for the value.


  • retRechargeMax - Returns the "Recharge Max". Maximum value to which the regenerating currency will automatically increment.

    • "" - The Currency to load the value.


  • retRechargeTime - Returns the "Recharge Time". Server timestamp in UTC indicating the next time the virtual currency will be incremented.

    • "" - The Currency to load the value.


  • retSecondsToRecharge - Returns the "Seconds To Recharge". Time remaining (in seconds) before the next recharge increment of the virtual currency.

    • "" - The Currency to load the value.


Redeem Code

  • redItemID - Returns the "Item ID". Unique identifier for the inventory item, as defined in the catalog.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • redItemInstanceID - Returns the "Item Instance ID". Unique item identifier for this specific instance of the item.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • redItemClass - Returns the "Item Class". Class name for the inventory item, as defined in the catalog.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • redDate - Returns the "Purchase Date". Timestamp for when this instance was purchased.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • redExpiration - Returns the "Expiration". Timestamp for when this instance will expire.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • redRemainingUses - Returns the "Remaining Uses". Total number of remaining uses, if this is a consumable item.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • redCatalogVersion - Returns the "Catalog Version" for the inventory item, when this instance was created.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • redDisplayName - Returns the "Display Name". CatalogItem.DisplayName at the time this item was purchased.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • redCustomData - Returns the "Custom Data" in JSON string. The custom data of the item upon redeem.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • redGetCustomData - Returns the "Custom Data" value from a key. The custom data of the item upon redeem.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".

    • Key - The key to get the value from the custom data.


  • redCurrency - Returns the "Unit Currency". Currency type for the cost of the catalog item.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • redPrice - Returns the "Unit Price". Cost of the catalog item in the given currency.

    • Index - The Index to lookup from the Received List. Collected from the latest "Redeem Coupon".


  • loopReceived - The LoopIndex from the "For Each Received" through the Array of received items granted by the "Redeem Coupon".


  • countReceived - The Received Count from the Array of received items granted by the "Redeem Coupon".


Add User Virtual Currency

  • addVirBalance - Returns the "Balance" of the virtual currency after modification.


  • addVirBalChange - Returns the "Balance Change". Amount added or subtracted from the user's virtual currency.


  • addVirPlayFabID - Returns the "PlayFabID". User currency that was added to.


  • addVirCurrency - Returns the "Virtual Currency". Name of the virtual currency which was modified.


Subtract User Virtual Currency

  • subVirBalance - Returns the "Balance" of the virtual currency after modification.


  • subVirBalChange - Returns the "Balance Change". Amount added or subtracted from the user's virtual currency.


  • subVirPlayFabID - Returns the "PlayFabID". User currency that was subtracted from.


  • subVirCurrency - Returns the "Virtual Currency". Name of the virtual currency which was modified.


Server Response

  • ServerResponse - Return the "Server Response" from every request from the PlayFab Server. The server response can also be shown in the "Chrome Developer Tools : Console", if in "debug mode".

Request

  • Tag - Return the "Tag" of the latest request.


Object   Properties

Plugin Properties

Properties
Showcase

Showcase

There is currently nothing to show, we will add more in the future.

Game Projects

Game Projects 

Instructions Kit

Specifications

  • Instructions - The game project contains instructions and steps on how to use the addon and its features.

  • Action, Conditions and Expressions - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks on the recommended ways of using the addon.

Supporters

Only

bottom of page