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

LifetimeGood

The LifetimeGood item can be used to offer items which are available as long as a player plays the game. More...

Import Statement: import Felgo 4.0
Inherits:

Item

Properties

Detailed Description

In comparison to SingleUseGood items LifetimeGood items are virtual goods that are available for the player for as long as he plays the game. So a LifetimeGood allows you to offer virtual goods that are bought only once and then kept forever. Furthermore your users can't buy more than one instance of the very same lifetime good item.

If your lifetime good is of type StorePurchase it can be restored with Store::restoreAllTransactions.

Race tracks, Game Upgrades and Buildings are good examples of Lifetime use Goods.

A simple example for a life time good looks like the following:

 Store {
 goods: [
     LifetimeGood {
       id: slowmotionGood
       itemId: "slowmotion_item_id"
       name: "Slow Motion"
       description: "Squabies move with less speed"
       purchaseType:  VirtualPurchase { itemId: goldCurrency.itemId; amount: 300; }
     }
   ]
 }

Further examples are no-ad upgrades or the removal of game restrictions of a free version of your game when using the StorePurchase purchase type. Here is an example for an in-app purchase for removing a possible app banner:

 Store {
   goods: [
     LifetimeGood {
       id: noadsGood
       itemId: "noads_id"

       purchaseType: StorePurchase { id: noAdPurchase; productId: noadsGood.itemId; }
     }
   ]
 }

Property Documentation

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 VirtualPurchase 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).

 LifetimeGood {
   id: slowmotionGood
   itemId: "slowmotion_item_id"
   name: "Slow Motion"
   description: "Squabies move with less speed"
   purchaseType:  VirtualPurchase { itemId: goldCurrency.itemId; amount: 300; }
 }

purchased : bool

A read-only property which is true if the user already purchased this item, or false if it's not in the inventory. You can use this property to bind another item's visibility or other property to the purchase state of this item.


Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded