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 VPlayPlugins.soomla 1.2
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.


Videos

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support