Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

CurrencyPack

The CurrencyPack item describes a purchasable collection of a specific virtual Currency within your game, buyable with StorePurchase. More...

Import Statement: import Felgo 4.0
Inherits:

Item

Properties

Detailed Description

The CurrencyPack item describes a purchasable collection of a specific Currency item.

Virtual currencies are used to provide a currency like coins or credits within your game play. Currencies can be purchased in volume (bundled within a CurrencyPack) by your players with a purchase type of StorePurchase.

Your game needs at least one Currency and one CurrencyPack defined in order to use offer a virtual economy.

A simple example for a currency (named "Gold") and a purchaseable currency pack (named "10 Pieces of Gold") looks like the following:

 Store {
   currencies: [
     Currency { id: goldCurrency; itemId: "currency_gold_id"; name: "Gold"; }
   ]

   currencyPacks: [
     CurrencyPack {
       id: gold10Pack
       itemId: "gold_pack_10_id"
       name: "10 Pieces of Gold"
       currencyId: goldCurrency.itemId // The currency you want to use for this pack
       currencyAmount: 10
       purchaseType:  StorePurchase { id: gold10Purchase; productId: gold10Pack; }
     }
   ]
 }

Note: The virtual economic model allows to define multiple currencies within the same game, in most cases a single cirtual currency should however be sufficient.

Property Documentation

currencyAmount : int

This property holds the amount of of the Currency which should be purchased with this CurrencyPack. The property is mandatory.


currencyId : string

This property holds the Currency::itemId of the Currency which should be purchased with this CurrencyPack. The property is mandatory.


description : string

A meta field for giving the item a description to display to the user. This property is not used internally but you can use it to display a common description within your game wherever you need to.

Be sure to set this property if you're making use of Store::printStoreProductLists as this greatly simplifies the publishing process of your game.


itemId : string

The itemId is a unique identifier for this item within your virtual store. The property is mandatory.


name : string

A meta field for giving the item a name to display to the user. This property is not used internally but you can use it to display a common name within your game wherever you need to.

Be sure to set this property if you're making use of Store::printStoreProductLists as this greatly simplifies the publishing process of your game.


purchaseType : PurchaseType

The purchaseType property defines how the item can be purchased. Possible values are instances of StorePurchase or VirtualPurchase. If you use the virtual economy model shipped with the Store plugin the StorePurchase type is preferred.

This property is mandatory. For convenience, you can reuse the currency pack's itemId for the purchase type's itemId or productId like in the example below. Keep however in mind that on iOS productIds must be unique across all your games and therefore should be prefixed for StorePurchase purchase types (see StorePurchase::productId for more details).

 CurrencyPack {
   id: gold10Pack
   itemId: "gold_pack_10_id"
   name: "10 Pieces of Gold"
   currencyId: goldCurrency.itemId // The currency you want to use for this pack
   currencyAmount: 10
   purchaseType:  StorePurchase { id: gold10Purchase; productId: gold10Pack; }
 }

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded