The SingleUsePackGood item describes a purchasable collection with a specific amount of a specific single use good. More...
Import Statement: | import Felgo 4.0 |
Inherits: |
In certain cases it's desirable to sell packs of single use goods that can be achieved with SingleUsePackGood items. Therefore SingleUsePackGood items are just bundles of SingleUseGood items. Beside selling bundles of goods you can also use these items to give a discount on items purchased in volume, i.e. purchasing a truck of green bananas might in sum be cheaper than purchasing each single banana on its own.
SingleUsePackGood items can be purchased an unlimited number of times. This kind of item does not have an own balance, instead the balance of the associated SingleUseGood is updated according to the amount defined in the pack.
A simple example for an additional one time usage weapon for Squaby looks like the following:
Store { goods: [ SingleUseGood { id: vacGood itemId: "vac_item_id" name: "Vacuum Cleaner" description: "All Squabies are sucked in by your mom's vacuum cleaner" purchaseType: VirtualPurchase { itemId: goldCurrency.itemId; amount: 50; } }, SingleUsePackGood { id: vacPackGood itemId: "vacpack_item_id" name: "5 Vacuum Cleaners" goodItemId: vacGood.itemId amount: 5 purchaseType: VirtualPurchase { itemId: goldCurrency.itemId; amount: 200; } } ] }
amount : int |
This property holds the amount of of the SingleUseGood which should be purchased with this SingleUsePackGood. 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.
goodItemId : string |
This property holds the SingleUseGood::itemId of the SingleUseGood which should be purchased with this SingleUsePackGood. The property is mandatory.
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).
SingleUsePackGood { id: vacPackGood itemId: "vacpack_item_id" name: "5 Vacuum Cleaners" goodItemId: vacGood.itemId amount: 5 purchaseType: VirtualPurchase { itemId: goldCurrency.itemId; amount: 200; } }