Currencies #

Currencies are implemented as stackable items and can be used for basic or rich implementations of store and crafting systems.

Quick Guides #

Purchasing an item from a store #

In this example, we’ll define a basic currency, use it in a store catalog, and enable sell back.

  1. Define a basic currency to be used in a store catalog:
  {
    "catalogId": "gold_coins",
    "name": "Gold Coins",
    "limit": 1000000,
    "tags": ["currency"],
    "removeIfNone": false
  }
  1. Add a store entry to enable purchasing a weapon for gold:
{
    "id": "buy_elf_double_blade",
    "receivedQuantityByCatalogId": {
        "elf_double_blade": 1
    },
    "costByCatalogId": {
        "gold_coins": { "cost": 10000 }
    }
}
  1. Add an additional entry to enable selling the item back:
{
    "id": "sell_elf_double_blade",
    "receivedQuantityByCatalogId": {
        "gold_coins": 750
    },
    "costByCatalogId": {
        "elf_double_blade": { "cost": 1 }
    }
}

Defining special event currencies #

This approach allows you to manage event content independently, including scheduling event schedules without impacting core game content.

  1. Define two special event currencies:
{
    "catalogId": "harvest_pumpkins",
    "name": "Harvest Pumpkins",
    "limit": 10000,
    "tags": ["currency", "harvest"],
    "removeIfNone": false
},
{
    "catalogId": "harvest_seeds",
    "name": "Harvest Seeds",
    "limit": 100000,
    "tags": ["currency", "harvest"],
    "removeIfNone": false
}
  1. Create a custom store scheduled for the event:
{
    "id": "harvest_store",
    "name": "Harvest Store",
    "storeEntries": [
        {
            "id": "buy_harvest_icon_jack",
            "receivedQuantityByCatalogId": {
                "harvest_icon_jack": 1
            },
            "costByCatalogId": {
                "harvest_seeds": { "cost": 250 },
                "harvest_pumpkins": { "cost": 1 }
            }
        },
        {
            "id": "buy_harvest_skin_jack",
            "receivedQuantityByCatalogId": {
                "harvest_skin_jack": 1
            },
            "costByCatalogId": {
                "harvest_seeds": { "cost": 2000 },
                "harvest_pumpkins": { "cost": 5 }
            }
        },
    ]
}