The store, currencies, offers and owned items.
133 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types ).
$ commerce . clear_random_granted_durables (user: User )
Server only. Clear out the list of recently granted durables (accessories) for the given user. After this commerce.get_random_granted_durables(..) will return an empty list until more random durables are granted.
Parameter Type Meaning userUserThe user.
$ commerce . clear_users_equipment ()
Clear the local cached equipment for all arbitrary users.
$ commerce . clear_users_equipment_by_users (users: list )
Clear the local cached equipment for a set of arbitrary users.
Parameter Type Meaning userslistThe users to clear
$ commerce . confirm_platform_purchase ()
Confirms the platform purchase and transfers goods into the inventory.
$ commerce . crew_clear_equipped (user: User )
Clear the local cache of crew equipment.
Parameter Type Meaning userUserThe user
$ commerce . crew_equip (accessories: list , user: User , is_debug: bool )
Equip crew accessories.
Parameter Type Meaning accessorieslistA list of references to .accessory files to equip. userUserThe user - should be the crew captain. is_debugboolTrue if this is a debug call.
$ commerce . deposit (currency: Reference , amount: int , user: User )
Deposit funds into the user's account.
Parameter Type Meaning currencyReferenceThe currency. amountintThe amount to deposit. userUserThe user for whom we're depositing.
$ commerce . equip (accessories: list , character_index: int , user: User , is_debug: bool )
Equip accessories.
Parameter Type Meaning accessorieslistA list of references to .accessory files to equip. character_indexintThe index of the character to whom we are equipping the accessories. This does not apply to all accessory types. userUserThe user. is_debugboolTrue if this is a debug call.
$ commerce . get_backfill_commerce_offer (offer_to_replace: Reference , season_schedule: Reference , year_schedule: Reference , historical_schedule: Reference , exclude_schedule: Reference , current_offers: list , season_day: int , year_day: int , debug_log_level: int , seed: int ) -> Reference
Retrieve a vcommerce_catalog_item_t from the catalog for backfill.
Parameter Type Meaning offer_to_replaceReference(optional) The offer to be replaced. A ref to a _commerce_offer_t season_scheduleReferenceThe commerce_schedule for the current season year_scheduleReferenceThe commerce schedule for the current year historical_scheduleReferenceThe commerce_schedule from previous years and events exclude_scheduleReferenceA commerce schedule containing offers which should be excluded from backfill current_offerslistA list of offers currently present in the Brawl Shop - Daily Items season_dayintThe day of the current season or event. year_dayintThe day of the current year. debug_log_levelint0 for no logging. 1 for basic logging. 2 for detailed list logging. seedintThe random seed used for backfill.
Returns Reference: A vcommerce_offer_t.
$ commerce . get_balance (currency: Reference ) -> int
Retrieve the balance of funds for a currency.
Parameter Type Meaning currencyReferenceShould be one of k_currency_gold_bars or k_currency_variant_coins.
Returns int: The balance.
$ commerce . get_bundle_background_texture_package (bundle_info: Reference ) -> Reference
Get the background_texture_package of the bundle.
Parameter Type Meaning bundle_infoReferenceThe bundle_info.
Returns Reference: The background_texture_package.
$ commerce . get_bundle_button_texture_package (bundle_info: Reference ) -> Reference
Get the button_texture_package of the bundle.
Parameter Type Meaning bundle_infoReferenceThe bundle_info.
Returns Reference: The button_texture_package.
$ commerce . get_bundle_currency (bundle_info: Reference , index: int ) -> string
Get the currency included in the bundle_info at the specified index.
Parameter Type Meaning bundle_infoReferenceThe bundle_info. indexintThe price index. [0, currency_count).
Returns string: The .currency alias (CUR, VAR, et al).
$ commerce . get_bundle_currency_amount (bundle_info: Reference , index: int ) -> int
Get quantity of the currency item at the specified index.
Parameter Type Meaning bundle_infoReferenceThe bundle_info. indexintThe price index. [0, currency_count).
Returns int: The quantity.
$ commerce . get_bundle_currency_count (bundle_info: Reference ) -> int
Get number of currencies in the bundle.
Parameter Type Meaning bundle_infoReferenceThe bundle_info.
Returns int: The currencies count.
$ commerce . get_bundle_display_name (bundle_info: Reference ) -> Reference
Get the localized display name of the bundle.
Parameter Type Meaning bundle_infoReferenceThe bundle_info.
Returns Reference: The display_name.
$ commerce . get_bundle_full_price (bundle_info: Reference , index: int ) -> int
Get the full price of the item in the bundle at the specified index.
Parameter Type Meaning bundle_infoReferenceThe bundle_info. indexintThe price index. [0, full_price_count).
Returns int: The full_price.
$ commerce . get_bundle_full_price_count (bundle_info: Reference ) -> int
Get the number of full price values of the bundle. These should match the items included in the bundle.
Parameter Type Meaning bundle_infoReferenceThe bundle_info.
Returns int: The full_price_count.
$ commerce . get_bundle_info_matches_id (bundle_info: Reference , id: string ) -> bool
Returns true if the bundle_info contains the id.
Parameter Type Meaning bundle_infoReferenceA ref to a vcatch_store_bundle_t. idstringA platform offer id as a string.
Returns bool: True if the vcatch_store_bundle_info_t contains the id.
$ commerce . get_bundle_item_quantity (bundle_info: Reference , index: int ) -> int
Get the quanity of the item in the bundle at the specified index.
Parameter Type Meaning bundle_infoReferenceThe bundle_info. indexintThe price index. [0, preview_accessory_count).
Returns int: The quantity.
$ commerce . get_bundle_logo_texture_package (bundle_info: Reference ) -> Reference
Get the logo_texture_package of the bundle.
Parameter Type Meaning bundle_infoReferenceThe bundle_info.
Returns Reference: The logo_texture_package.
$ commerce . get_bundle_name (bundle_info: Reference ) -> string
Get the name of the bundle.
Parameter Type Meaning bundle_infoReferenceThe bundle_info.
Returns string: The name.
$ commerce . get_bundle_offer (bundle_info: Reference ) -> Reference
Get the commerce_offer for the bundle.
Parameter Type Meaning bundle_infoReferenceThe bundle_info.
Returns Reference: The offer.
$ commerce . get_bundle_original_cost (bundle_info: Reference ) -> int
Get the original cost of the bundle.
Parameter Type Meaning bundle_infoReferenceThe bundle_info.
Returns int: The original_cost.
$ commerce . get_bundle_owned (bundle_info: Reference ) -> bool
Get the ownership status of a bundle. This should only be used to check the ownership of real money bundles.
Parameter Type Meaning bundle_infoReferenceThe bundle to check.
Returns bool: True if the bundle is owned.
$ commerce . get_bundle_preview_accessory (bundle_info: Reference , index: int ) -> Reference
Get the preview_accessory from the bundle at the specified index.
Parameter Type Meaning bundle_infoReferenceThe bundle_info. indexintThe accessory index. [0, preview_accessory_count).
Returns Reference: The preview_accessory.
$ commerce . get_bundle_preview_accessory_count (bundle_info: Reference ) -> int
Get the number of preview accessories in the bundle.
Parameter Type Meaning bundle_infoReferenceThe bundle_info.
Returns int: The preview_accessory_count.
$ commerce . get_bundle_schedule_bundle_info (schedule: Reference , index: int ) -> Reference
Get the bundle_info at the index in the schedule.
Parameter Type Meaning scheduleReferenceThe bundle schedule. indexintThe index of the bundle_info.
Returns Reference: The bundle_info ref for the bundle.
$ commerce . get_bundle_schedule_end_day (schedule: Reference , index: int ) -> int
Get get day value of the bundle's scheduled end date.
Parameter Type Meaning scheduleReferenceThe bundle schedule. indexintThe index of the offer.
Returns int: The day value of the end date.
$ commerce . get_bundle_schedule_end_month (schedule: Reference , index: int ) -> int
Get get month value of the bundle's scheduled end date.
Parameter Type Meaning scheduleReferenceThe bundle schedule. indexintThe index of the offer.
Returns int: The month value of the end date.
$ commerce . get_bundle_schedule_end_year (schedule: Reference , index: int ) -> int
Get get year value of the bundle's scheduled end date.
Parameter Type Meaning scheduleReferenceThe bundle schedule. indexintThe index of the offer.
Returns int: The year value of the end date.
$ commerce . get_bundle_schedule_has_end (schedule: Reference , index: int ) -> bool
Get whether the bundle at the index in the schedule has an end date.
Parameter Type Meaning scheduleReferenceThe bundle schedule. indexintThe index of the offer.
Returns bool: True if the bundle offer has an end date.
$ commerce . get_bundle_schedule_has_start (schedule: Reference , index: int ) -> bool
Get whether the bundle at the index in the schedule has a start date.
Parameter Type Meaning scheduleReferenceThe bundle schedule. indexintThe index of the offer.
Returns bool: True if the bundle offer has a start date.
$ commerce . get_bundle_schedule_length (schedule: Reference ) -> int
Get the number of offers in the schedule.
Parameter Type Meaning scheduleReferenceThe bundle schedule.
Returns int: The length of the list of offers in the schedule.
$ commerce . get_bundle_schedule_start_day (schedule: Reference , index: int ) -> int
Get get day value of the bundle's scheduled start date.
Parameter Type Meaning scheduleReferenceThe bundle schedule. indexintThe index of the offer.
Returns int: The day value of the start date.
$ commerce . get_bundle_schedule_start_month (schedule: Reference , index: int ) -> int
Get get month value of the bundle's scheduled start date.
Parameter Type Meaning scheduleReferenceThe bundle schedule. indexintThe index of the offer.
Returns int: The month value of the start date.
$ commerce . get_bundle_schedule_start_year (schedule: Reference , index: int ) -> int
Get get year value of the bundle's scheduled start date.
Parameter Type Meaning scheduleReferenceThe bundle schedule. indexintThe index of the offer.
Returns int: The year value of the start date.
$ commerce . get_catalog_offer (index: int ) -> Reference
Retrieve a vcommerce_catalog_item_t from the catalog.
Parameter Type Meaning indexintThe index of the catalog item. Must be in the range [0, commerce.get_catalog_offer_count()).
Returns Reference: A reference to a vcommerce_catalog_item_t.
$ commerce . get_catalog_offer_count () -> int
Retrieve the number of offered items in the catalog.
Returns int: The number of offered items.
$ commerce . get_catalog_offer_for_day (schedule: Reference , day: int , slot: int ) -> Reference
Get a daily offer from the catalog.
Parameter Type Meaning scheduleReferenceA season's commerce_schedule. dayintThe season day. slotintThe store slot to query [0-schedule.days[day].offer_slots.length).
Returns Reference: Reference to a vcommerce_catalog_item_t.
$ commerce . get_catalog_offer_from_commerce_offer (offer: Reference ) -> Reference
Get a offer from the catalog based on a commerce offer.
Parameter Type Meaning offerReferenceA reference to a commerce offer.
Returns Reference: Reference to a vcommerce_catalog_item_t.
$ commerce . get_catalog_offers_matching (currency: Reference , accessory: Reference , currency_granted: Reference , max_offers: int , min_price: int , max_price: int ) -> list
Retrieve a list of vcommerce_catalog_item_t from the catalog that match the optional arguments.
Parameter Type Meaning currencyReference(optional) The currency to look for. (A reference to a .currency file.) accessoryReference(optional) The accessory to look for. (A reference to a .accessory file.) currency_grantedReference(optional) The currency granted to look for. (A reference to a .currency file.) max_offersint(optional) The maximum number of offers to add to the list. If default (0) is passed, it will return all matches. min_priceint(optional) The minimum price for the offer. max_priceint(optional) The maximum price for the offer.
Returns list: A list of references to vcommerce_catalog_item_t.
$ commerce . get_code_redemption_item_guid (item_index: int ) -> string
Get the GUID for an item at a given index.
Parameter Type Meaning item_indexintIndex of into commerce->code_redemption_items
Returns string: GUID of item at index.
$ commerce . get_code_redemption_item_quantity (item_index: int ) -> int
Get the quantity for an item at a given index.
Parameter Type Meaning item_indexintIndex of into commerce->code_redemption_items
Returns int: Quantity of item at index.
$ commerce . get_code_redemption_items_count () -> int
Get number of items redeemed from the last code redemption request.
Returns int: Number of code redemption items.
$ commerce . get_code_redemption_state () -> int
Get state of the last code redemption request.
Returns int: Enum value of type vonline_commerce_code_redemption_state_t
$ commerce . get_commerce_offer_for_day (schedule: Reference , day: int , slot: int ) -> Reference
Get a daily offer from a commerce_schedule.
Parameter Type Meaning scheduleReferenceA season's commerce_schedule. dayintThe season day. slotintThe store slot to query [0-schedule.days[day].offer_slots.length).
Returns Reference: Reference to a .commerce_offer.
$ commerce . get_commerce_offer_items (offer: Reference ) -> list
Get the contents purchased through the offer. This will be a list of refs to .accessory files.
Parameter Type Meaning offerReferenceA reference to the vcommerce_offer_t.
Returns list: The list of .accessory file references.
$ commerce . get_commerce_offer_purchase_limit (offer: Reference ) -> int
Get purchase limit of the offer.
Parameter Type Meaning offerReferenceA reference to the .commerce_offer.
Returns int: The purchase limit.
$ commerce . get_commerce_offer_slot_accessories (offer: Reference , slot_index: int ) -> list
Get the accessories in the commerce offer slot
Parameter Type Meaning offerReferenceA reference to the vcommerce_offer_t. slot_indexintThe slot index of the item in the offer.
Returns list: The accessories in the commerce offer slot.
$ commerce . get_commerce_offer_slot_count (offer: Reference ) -> int
Get the number of item slots in the commerce offer
Parameter Type Meaning offerReferenceA reference to the vcommerce_offer_t.
Returns int: The number of items in the commerce offer.
$ commerce . get_commerce_offer_slot_quantity (offer: Reference , slot_index: int ) -> int
Get the quantity of items in the commerce offer slot
Parameter Type Meaning offerReferenceA reference to the vcommerce_offer_t. slot_indexintThe slot index of the item in the offer.
Returns int: The number quantity of items in the commerce offer slot.
$ commerce . get_crew_inventory_contains_durable (durable: Reference ) -> bool
Search a player's crew inventory to see if it contains a given durable
Parameter Type Meaning durableReferenceThe durable to look for (a reference to a .accessory file).
Returns bool: If the inventory contains the given durable.
$ commerce . get_crew_inventory_durable_accessory (index: int ) -> Reference
Retrieve a durable from the player's crew inventory.
Parameter Type Meaning indexintThe index of the durable to return. Must be in the range [0, commerce.get_inventory_durable_count()).
Returns Reference: A ref to the .accessory for the durable.
$ commerce . get_crew_inventory_durable_by_type_accessory (type: int , index: int ) -> Reference
Retrieve a durable from the player's crew inventory.
Parameter Type Meaning typeintThe type of the durable to look for. (vcatch_accessory_type_t) indexintThe index of the durable in the subset of accessories of its type to return. Must be in the range [0, commerce.get_inventory_durable_by_type_count()).
Returns Reference: A ref to the .accessory for the durable.
$ commerce . get_crew_inventory_durable_by_type_count (type: int ) -> int
Retrieve the number of durables of the given type in a player's crew inventory. These are what they 'own,' not what they're 'wearing.'
Parameter Type Meaning typeintThe type of the durable to look for. (vcatch_accessory_type_t)
Returns int: The number of durables of the given type.
$ commerce . get_crew_inventory_durable_count () -> int
Retrieve the number of durables in a player's crew inventory. These are what they 'own,' not what they're 'wearing.'
Returns int: The number of durables.
$ commerce . get_crew_inventory_durable_unlock_count (durable: Reference ) -> int
Search a player's crew inventory for a given durable & return the number of users in the crew who have purchased/unlocked it.
Parameter Type Meaning durableReferenceThe durable to look for (a reference to a .accessory file).
Returns int: Number of crew members who own the durable.
$ commerce . get_crew_inventory_durables_by_type_accessory (type: int ) -> list
Retrieve a list of durables from the player's crew inventory.
Parameter Type Meaning typeintThe type of the durables to look for. (vcatch_accessory_type_t)
Returns list: A list of refs to .accessory for the durables.
$ commerce . get_crew_inventory_exists () -> bool
Check if the players crew inventory exists
Returns bool: If the inventory contains the given durable.
$ commerce . get_currency_with_alias (currencies: list , alias: string ) -> Reference
Searches a list of .currency refs for one whose alias matches the specified alias.
Parameter Type Meaning currencieslistThe list of .currency refs. aliasstringThe currency alias to match.
Returns Reference: The matching .currency ref
$ commerce . get_inventory_consumable_accessory (index: int , user: User ) -> Reference
Retrieve a consumable from the player's inventory.
Parameter Type Meaning indexintThe index of the consumable to return. Must be in the range [0, commerce.get_inventory_consumable_count()). userUserThe user.
Returns Reference: A ref to the .accessory for the consumable.
$ commerce . get_inventory_consumable_by_type_count (type: int , user: User ) -> int
Retrieve the number of consumables of the given type in a player's inventory.
Parameter Type Meaning typeintThe type of the consumable to look for. (vcatch_accessory_type_t) userUserThe user.
Returns int: The number of consumables of the given type.
$ commerce . get_inventory_consumable_by_type_index (type: int , index: int , user: User ) -> int
Retrieve the index of a consumable in a player's inventory, or -1 on failure.
Parameter Type Meaning typeintThe type of the consumable to look for. (vcatch_accessory_type_t) indexintThe index of the consumable in the subset of accessories of its type whose index to return. Must be in the range [0, commerce.get_inventory_consumable_by_type_count()). userUserThe user.
Returns int: The index in the range [0, commerce.get_inventory_consumable_count()).
$ commerce . get_inventory_consumable_count (user: User ) -> int
Retrieve the number of consumables in a player's inventory.
Parameter Type Meaning userUserThe user.
Returns int: The number of consumables.
$ commerce . get_inventory_consumable_index (consumable: Reference , user: User ) -> int
Return the index of a consumable in a player's consumable inventory, or -1 if the consumable was not found in the player's inventory.
Parameter Type Meaning consumableReferenceThe consumable to look for (a reference to a .accessory file). userUserThe user.
Returns int: The index in the range [0, commerce.get_inventory_consumable_count()).
$ commerce . get_inventory_consumable_quantity (index: int , user: User ) -> int
Return the quantity of a given consumable a player owns.
Parameter Type Meaning indexintThe index of the consumable to query. Must be in the range [0, commerce.get_inventory_consumable_count()). userUserThe user.
Returns int: The quantity of the consumable.
$ commerce . get_inventory_contains_durable (durable: Reference , restrict_platform: bool ) -> bool
Search a player's inventory to see if it contains a given durable
Parameter Type Meaning durableReferenceThe durable to look for (a reference to a .accessory file). restrict_platformboolIf true the the accessory must also match the current platform.
Returns bool: If the inventory contains the given durable.
$ commerce . get_inventory_durable_accessory (index: int ) -> Reference
Retrieve a durable from the player's inventory.
Parameter Type Meaning indexintThe index of the durable to return. Must be in the range [0, commerce.get_inventory_durable_count()).
Returns Reference: A ref to the .accessory for the durable.
$ commerce . get_inventory_durable_by_type_accessory (type: int , index: int ) -> Reference
Retrieve a durable from the player's inventory.
Parameter Type Meaning typeintThe type of the durable to look for. (vcatch_accessory_type_t) indexintThe index of the durable in the subset of accessories of its type to return. Must be in the range [0, commerce.get_inventory_durable_by_type_count()).
Returns Reference: A ref to the .accessory for the durable.
$ commerce . get_inventory_durable_by_type_count (type: int ) -> int
Retrieve the number of durables of the given type in a player's inventory. These are what they 'own,' not what they're 'wearing.'
Parameter Type Meaning typeintThe type of the durable to look for. (vcatch_accessory_type_t)
Returns int: The number of durables of the given type.
$ commerce . get_inventory_durable_count () -> int
Retrieve the number of durables in a player's inventory. These are what they 'own,' not what they're 'wearing.'
Returns int: The number of durables.
$ commerce . get_inventory_durables_by_type_accessory (type: int , body_type_substring: string , base_only: bool ) -> list
Retrieve a list of durables from the player's inventory.
Parameter Type Meaning typeintThe type of the durables to look for. (vcatch_accessory_type_t) body_type_substringstringBody type substring to filter by. base_onlyboolIf we should filter for base accessories only.
Returns list: A list of refs to .accessory for the durables.
$ commerce . get_inventory_equipped_accessory (index: int , user: User ) -> Reference
Return a reference to a .accessory file for an equipped accessory.
Parameter Type Meaning indexintThe index of the equipped accessory to return. Must be in the range [0, commerce.get_inventory_equipped_count()). userUserThe user.
Returns Reference: The equipped .accessory ref.
$ commerce . get_inventory_equipped_accessory_by_type_and_index (accessory_type: int , character_index: int , user: User ) -> Reference
Return a reference to a .accessory file for an equipped accessory given an accessory type and a character index.
Parameter Type Meaning accessory_typeintThe accessory type to check. character_indexintThe character index to check. userUserThe user.
Returns Reference: The equipped .accessory ref.
$ commerce . get_inventory_equipped_count (user: User ) -> int
Return the number of equipped accessories.
Parameter Type Meaning userUserThe user.
Returns int: The number of equipped accessories.
$ commerce . get_inventory_equipped_slot (index: int , user: User ) -> string
Return a string representing the slot for the equipped index.
Parameter Type Meaning indexintThe index of the equipped accessory to return. Must be in the range [0, commerce.get_inventory_equipped_count()). userUserThe user.
Returns string: The slot string.
$ commerce . get_offer_contents (offer: Reference ) -> list
Get the contents purchased through the offer. This will be a list of refs to .accessory files.
Parameter Type Meaning offerReferenceA reference to the vcommerce_catalog_item_t.
Returns list: The list of .accessory file references.
$ commerce . get_offer_count_for_day (schedule: Reference , day: int ) -> int
Get the number of offer slots in one day of a commerce_schedule.
Parameter Type Meaning scheduleReferenceA .commerce_schedule. dayintThe day in the schedule.
Returns int: The number of offers in a specific day for the given schedule.
$ commerce . get_offer_currencies (offer: Reference ) -> list
Get the currencies purchased through the offer. This will be a list of strings to .currency file aliases (CUR or VAR).
Parameter Type Meaning offerReferenceA reference to the vcommerce_catalog_item_t.
Returns list: The list of currency strings.
$ commerce . get_offer_currency_string (offer: Reference ) -> string
Get the currency used for a given offer.
Parameter Type Meaning offerReferenceA reference to the vcommerce_catalog_item_t.
Returns string: The currency for the offer.
$ commerce . get_offer_guid_temp (offer: Reference ) -> string
Get guid of a commerce_offer in a temp string.
Parameter Type Meaning offerReferenceA reference to the vcommerce_catalog_item_t.
Returns string: The guid.
$ commerce . get_offer_price (offer: Reference ) -> int
Get the price of a given offer.
Parameter Type Meaning offerReferenceA reference to the vcommerce_catalog_item_t.
Returns int: The price.
$ commerce . get_offer_quantities (offer: Reference ) -> list
Get quantity of each content item.
Parameter Type Meaning offerReferenceA reference to the vcommerce_catalog_item_t.
Returns list: The quantities.
$ commerce . get_offer_quantity (offer: Reference , accessory: Reference ) -> int
Get quantity of each content item.
Parameter Type Meaning offerReferenceA reference to the vcommerce_catalog_item_t. accessoryReferenceA reference to the vcatch_accessory_t.
Returns int: The quantity.
$ commerce . get_offer_type_for_day (schedule: Reference , day: int , slot: int ) -> int
Get a daily offer's type.
Parameter Type Meaning scheduleReferenceA season's commerce_schedule. dayintThe season day. slotintThe store slot to query [0-schedule.days[day].offer_slots.length).
Returns int: Offer type (vcatch_offer_type_t) e.g. k_offer_type_featured
$ commerce . get_platform_entitlements () -> list
Get a list of the active platform entitlements.
Returns list: A list of strings of the platform entitlements. NULL if not available
$ commerce . get_platform_offer_count () -> int
Retrieve the number of platform offers in the catalog.
Returns int: The number of offered items.
$ commerce . get_platform_offer_description (offer_index: int ) -> string
Get the description text of a platform offer.
Parameter Type Meaning offer_indexintIndex into the catalog->real_money_offers array.
Returns string: A string containing the description of a vonline_platform_offer_t.
$ commerce . get_platform_offer_id (offer_index: int ) -> string
Get the platform ID of a platform offer.
Parameter Type Meaning offer_indexintIndex into the catalog->real_money_offers array.
Returns string: Platform ID of the offer.
$ commerce . get_platform_offer_info_amount (offer_info: Reference ) -> int
Get the amount of a platform_offer_offer_info.
Parameter Type Meaning offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.
Returns int: The portion of the offer that is consdered the base amount of currency.
$ commerce . get_platform_offer_info_amount_bonus (offer_info: Reference ) -> int
Get the bonus amount of a platform_offer_offer_info.
Parameter Type Meaning offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.
Returns int: The portion of the offer that is consdered a bonus amount of currency.
$ commerce . get_platform_offer_info_icon (offer_info: Reference ) -> Reference
Get the icon texture of a platform_offer_offer_info.
Parameter Type Meaning offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.
Returns Reference: A ref for the texture to display for this offer.
$ commerce . get_platform_offer_info_is_deluxe (offer_info: Reference ) -> bool
Get the value of the deluxe_edition field of a platform_offer_offer_info.
Parameter Type Meaning offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.
Returns bool: A bool describing if the vonline_platform_offer_item_t is for the deluxe edition.
$ commerce . get_platform_offer_info_is_featured (offer_info: Reference ) -> bool
Get the value of the featured field of a platform_offer_offer_info.
Parameter Type Meaning offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.
Returns bool: A bool describing if the vonline_platform_offer_item_t is a featured offer.
$ commerce . get_platform_offer_info_is_standard (offer_info: Reference ) -> bool
Get the value of the standard_edition field of a platform_offer_offer_info.
Parameter Type Meaning offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.
Returns bool: A bool describing if the vonline_platform_offer_item_t is for the standard edition.
$ commerce . get_platform_offer_info_matches_id (offer_info: Reference , id: string ) -> bool
Returns true if the platform_offer_info contains the id.
Parameter Type Meaning offer_infoReferenceA ref to a vcommerce_platform_offer_info_t. idstringA platform offer id as a string.
Returns bool: True if the vcommerce_platform_offer_info_t contains the id.
$ commerce . get_platform_offer_item_base_price (offer_index: int , item_index: int ) -> string
Get the formatted base price of a platform offer item.
Parameter Type Meaning offer_indexintIndex into the catalog->real_money_offers array. item_indexintIndex into the catalog->real_money_offers[offer_index]->items array.
Returns string: A formatted string for the base price of a vonline_platform_offer_item_t.
$ commerce . get_platform_offer_item_id (offer_index: int , item_index: int ) -> string
Get the platform ID of a platform offer item.
Parameter Type Meaning offer_indexintIndex into the catalog->real_money_offers array. item_indexintIndex into the catalog->real_money_offers[offer_index]->items array.
Returns string: A string with the platform ID of a vonline_platform_offer_item_t.
$ commerce . get_platform_offer_item_name (offer_index: int , item_index: int ) -> string
Get the localized name for the item of a platform offer item.
Parameter Type Meaning offer_indexintIndex into the catalog->real_money_offers array. item_indexintIndex into the catalog->real_money_offers[offer_index]->items array.
Returns string: A string containing the name of a vonline_platform_offer_item_t.
$ commerce . get_platform_offer_item_sale_price (offer_index: int , item_index: int ) -> string
Get the formatted sale price of a platform offer item.
Parameter Type Meaning offer_indexintIndex into the catalog->real_money_offers array. item_indexintIndex into the catalog->real_money_offers[offer_index]->items array.
Returns string: A formatted string for the sale price of a vonline_platform_offer_item_t.
$ commerce . get_platform_offer_items_count (offer_index: int ) -> int
Retrieve the number of items in the platform offer.
Parameter Type Meaning offer_indexintIndex into the catalog->real_money_offers array.
Returns int: The number of vonline_platform_offer_item_t in a vonline_platform_offer_t.
$ commerce . get_purchase_result () -> int
Retrieve the result of the last call to commerce.purchase().
Returns int: The purchase result of type purchase_result_t.
$ commerce . get_random_granted_durables (user: User ) -> list
Server only. Return a (possibly empty) list durables (accessories) granted to the given user.
Parameter Type Meaning userUserThe user.
Returns list: The list of recently granted durables.
$ commerce . get_random_reward_accessory_by_index (user: User , index: int ) -> Reference
Server only. Return accessory of a random reward by index.
Parameter Type Meaning userUserThe user to get random reward indexintThe index of the random reward
Returns Reference: The accessory of the random reward by index.
$ commerce . get_random_reward_quantity_by_index (user: User , index: int ) -> int
Server only. Return quantity of a random reward by index.
Parameter Type Meaning userUserThe user to get random reward indexintThe index of the random reward
Returns int: The quantity of the random reward by index.
$ commerce . get_random_rewards_length (user: User ) -> int
Server only. Return length of the random rewards for a given user.
Parameter Type Meaning userUserThe user to get random rewards.
Returns int: The length of the random rewards for a given user.
$ commerce . get_sanitized_price_string (price_string: string ) -> string
Get the sanitized price string if sanitization of unsupported characters is applicable.
Parameter Type Meaning price_stringstringThe price string to be sanitized.
Returns string: The price string, sanitized of any unsupported characters.
$ commerce . get_schedule_days_count (schedule: Reference ) -> int
Get the number of days in a commerce_schedule.
Parameter Type Meaning scheduleReferenceA .commerce_schedule.
Returns int: The number of days in a given schedule.
$ commerce . get_schedule_slot_count (schedule: Reference , day: int ) -> int
Number of slots in a given day in a commerce_schedule.
Parameter Type Meaning scheduleReferenceA .commerce_schedule. dayintThe season day.
Returns int: The number of slots in a given day of a given schedule.
$ commerce . get_tax_message () -> string
Get the tax message if applicable.
Returns string: Tax message for active region.
$ commerce . get_user_inventory_contains_durable (durable: Reference , restrict_platform: bool , user: User ) -> bool
Search a specific user's inventory to see if it contains a given durable
Parameter Type Meaning durableReferenceThe durable to look for (a reference to a .accessory file). restrict_platformboolIf true the the accessory must also match the current platform. userUserThe user whose inventory we are searching.
Returns bool: If the user inventory contains the given durable.
$ commerce . grant_consumables (consumables: list , quantities: list , user: User )
Server only. Grant the quantities of a list of consumables for a given user's inventory.
Parameter Type Meaning consumableslistThe consumables (references to .accessory files). quantitieslistThe quantities to add for each of the consumables. userUserThe user.
$ commerce . grant_durables (durables: list , user: User , exclude_owned: bool )
Server only. Add a list of durables directly to a user's inventory.
Parameter Type Meaning durableslistThe list of durables to grant. For Catch, references to .accessory files. userUserThe user. exclude_ownedboolShould owned items be excluded from the grant.
$ commerce . grant_durables_from_catalogs (catalogs: list , user: User )
Intended for debug purposes. Grant all durables from a list of catalog.vscript components.
Parameter Type Meaning catalogslistList of catalog components. userUserThe user.
$ commerce . has_arbitrary_user_equipment (user: User ) -> bool
Returns if the user has their equipment in the equipment cache.
Parameter Type Meaning userUserThe user to check
Returns bool: True if the user's equipment is in the cache.
$ commerce . has_received_equipment_for_user (user: User ) -> bool
Return whether any equipment data has been received from the backend for the given user. Whether or not the equipment is resolvable to an accessory file locally is irrelevant. Will return false for a user with no equipment data on the backend (a new user for instance).
Parameter Type Meaning userUserThe user.
Returns bool: Whether or not equipment data has been received for the given user.
$ commerce . has_received_equipment_for_user_by_slot (user: User , character_index: int ) -> bool
Return whether any equipment data has been received from the backend for the given user on a given slot. Whether or not the equipment is resolvable to an accessory file locally is irrelevant. Will return false for a user with no equipment data on the backend (a new user for instance).
Parameter Type Meaning userUserThe user. character_indexintThe character index.
Returns bool: Whether or not equipment data has been received for the given user.
$ commerce . is_commerce_offer_consumable (offer: Reference ) -> bool
Returns true if the commerce offer contains a consumable item as its first item.
Parameter Type Meaning offerReferenceA reference to the vcommerce_offer_t.
Returns bool: If the commerce offer contains a consumable item as its first item.
$ commerce . is_platform_offer_item_on_sale (offer_index: int , item_index: int ) -> bool
Is the platform offer item on sale?
Parameter Type Meaning offer_indexintIndex into the catalog->real_money_offers array. item_indexintIndex into the catalog->real_money_offers[offer_index]->items array.
Returns bool: A bool describing if the vonline_platform_offer_item_t is on sale.
$ commerce . open_packs (packs: list , user: User , suppress_message: bool )
Server only. Open a list of packs into the user's inventory.
Parameter Type Meaning packslistA list of references to .random_reward files. userUserThe user. suppress_messageboolPass in true if you don't wish to receive an 'event net_random_durables_granted' on success.
$ commerce . open_platform_store ()
Opens the first party store and show the games offers.
$ commerce . purchase (offer: Reference )
Purchase an offer.
Parameter Type Meaning offerReferenceA reference to a vcommerce_catalog_item_t.
$ commerce . purchase_platform_offer (offer_id: string )
Purchase a platform offer.
Parameter Type Meaning offer_idstringThe platform ID of the vonline_platform_offer_t to purchase.
$ commerce . redeem_code (code: string )
Redeem a code.
Parameter Type Meaning codestringThe code to redeem.
Query the backend to get our updated crew inventory.
$ commerce . refresh_platform_entitlements ()
Refresh the platform entitlements.
$ commerce . request_users_equipment (users: list )
Request the equipment for a set of arbitrary users.
Parameter Type Meaning userslistThe users to request the inventory for
$ commerce . reset_account (user: User )
Debug function to reset an account to the initial state.
Parameter Type Meaning userUserThe user.
$ commerce . restore_platform_purchases ()
Refresh the platform purchases (iOS only).
$ commerce . set_consumables (consumables: list , quantities: list , user: User )
Server only. Set the quantities of a list of consumables for a given user's inventory. Requires that the consumable is already in the inventory.
Parameter Type Meaning consumableslistThe consumables (references to .accessory files). quantitieslistThe new quantities of each of the consumables. userUserThe user.
$ commerce . set_store_icon (state: int )
Set the state of the first party store icon (PlayStation only).
Parameter Type Meaning stateintThe icon state. See k_vonline_icon_left, etc.
$ commerce . show_empty_store_dialog () -> bool
Show the system empty store dialog (PlayStation only).
Returns bool: A bool describing if any action was taken to open a dialog for the platform.