TPStashEvent.UseCurrency

public int UseCurrency(
    string player_uuid,
    string character_uuid,
    string currency_slug,
    float currency_quantity,
    [float? currency_total_quantity = null],
    [entity where_to_entity = entity.None],
    [string where_to_category_slug = null],
    [string where_to_slug = null]
);

Description

UseCurrency collects the data of the character’s spending of in-game currency. It needs to be called when an event of currency consumption occurs in the middle of the game. It can be used for the analysis of personas about currency consumption.

It returns 1 for success and -1 for failure. If -1 is returned, you can see the following message in the Unity editor console in TentuPlay debug mode:

TPError||ERROR inserting table_name: exception_error_message

Parameters

Name Description Required

player_uuid

Player’s unique ID (not a character’s ID) such as Steam user ID and Google Play user ID

Required

character_uuid

Player’s character’s unique lD

If there is no character in the game or If you want to use it for the player, not a character, set character_uuid to TentuPlayKeyword._DUMMY_CHARACTER_ID_.

Required

currency_slug

Unique identifier of currency such as "gold", "diamond", and "crystal"

Required

currency_quantity

The number or amount of currency used

Required

currency_total_quantity

The total number or amount of reserved currency after currency usage

This parameter is not mandatory but highly recommended as it helps create more accurate currency reserve status.

Optional

where_to_entity

The purpose for which the character uses the currency

Entities
public enum entity {
    None,
    Etc,
    Join,
    LoginApp,
    LoginAsCharacter,
    InAppPurchase,
    ShopPurchase,
    Trade,
    WatchAd,
    PlayQuest,
    GetBonus,
    ChangeCharacterArchetype,
    ChangeStat,
    ChangeCustomAbility,
    PlayStage,
    GetCharacter,
    GetCurrency,
    GetInfrastructure,
    GetPet,
    GetToken,
    GetConsumable,
    GetMaterial,
    GetEquipment,
    GetCostume,
    GetRandomBox,
    UseCurrency,
    EquipInfrastructure,
    EquipPet,
    UseToken,
    UseConsumable,
    UseMaterial,
    EquipEquipment,
    EquipCostume,
    OpenRandomBox,
    EquipSkill,
    DismissCharacter,
    DismissInfrastructure,
    DismissPet,
    DismissToken,
    DismissConsumable,
    DismissMaterial,
    DismissEquipment,
    DismissCostume,
    DismissRandomBox,
    LevelUpCharacter,
    LevelUpInfrastructure,
    LevelUpPet,
    LevelUpConsumable,
    LevelUpMaterial,
    LevelUpEquipment,
    LevelUpCostume,
    LevelUpSkill,
    Deposit,
    Withdraw,
    FinishedTutorial,
}

Optional

where_to_category_slug

The category of place, situation, or outcome to which the player gets by using the currency

Optional

where_to_slug

The name of place, situation, or outcome to which the player gets by using the currency

Optional