Links buy, sell, production, and unlock prices to an item or skill page.

economyLink#

The addon that connects an in-game item or piece of content to the currencies and global variables that run its economy. Defines buy, sell, production, and unlock prices in one unified structure.

Why it matters#

Cheap item, expensive item, premium item, event-unlockable item — all of that is "economy". Without a dedicated addon, you scatter those numbers in loose fields all over the item page, and when you need to rebalance the game (raise all prices by 10%, give a 50% discount during an event), you have to hunt through 80 different places.

This addon centralizes everything, and it also references globalVariable so you can adjust everything at once (e.g. a variable item_buy_discount = 0.1 applied to all purchases).

Where it usually lives#

  • Pages of type 🎒 Items or ⚔️ Items with Effect — comes by default along with Inventory.
  • Blank pages that represent something sellable (a skin, a chapter, an extra slot).

Singleton — 1 economyLink per page.

Schema#

CampoTipoPadrãoDescrição
idYesstringInternal ID.
nameYesstringAddon name (default: Economy).
hasBuyConfigbooleanToggles the buy block on/off. Allows non-purchasable items.
buyCurrencyRefstring (sectionId)Page of the currency used for buying.
buyValuenumberBase buy price.
minBuyValuenumberPrice floor even with maximum discounts.
buyModifiersEconomyModifierRef[]List of globalVariables that adjust the buyValue (e.g. seasonal discount).
hasSellConfigbooleanToggles the sell block on/off.
sellCurrencyRefstring (sectionId)Currency received on sale (usually the same as the buy currency).
sellValuenumberBase sell value.
maxSellValuenumberSell ceiling even with maximum bonuses.
sellModifiersEconomyModifierRef[]globalVariables that increase/decrease sellValue.
hasProductionConfigbooleanToggles production on/off. Item produces X units per interval.
producedItemRefstring (sectionId)Item this page produces when placed (e.g. a chicken produces eggs).
produceMinnumberMinimum amount produced per cycle.
produceMaxnumberMaximum amount produced per cycle.
productionTimeSecondsnumberInterval between cycles. Accepts decimals.
hasUnlockConfigbooleanToggles unlock gate on/off.
unlockRefstring (sectionId)Currency used to unlock.
unlockValuenumberHow much it costs to unlock for the first time.
notesstringFree-form notes.

EconomyModifierRef#

{ refId: string }  // sectionId of a globalVariable page

Points to a globalVariable (e.g. item_buy_discount, event_sell_markup). The engine reads the variable's value at runtime and applies it on top of buyValue/sellValue.

Example#

Iron Sword — buyable and sellable, with a seasonal discount:

{
  "id": "econ-iron-sword",
  "name": "Economy",
  "hasBuyConfig": true,
  "buyCurrencyRef": "section-gold",
  "buyValue": 100,
  "minBuyValue": 50,
  "buyModifiers": [
    { "refId": "section-buy-discount-var" }
  ],
  "hasSellConfig": true,
  "sellCurrencyRef": "section-gold",
  "sellValue": 50,
  "maxSellValue": 80,
  "sellModifiers": [
    { "refId": "section-sell-markup-var" }
  ],
  "hasUnlockConfig": false
}

Optional blocks by default#

Each block (Buy, Sell, Production, Unlock) has a has*Config boolean that toggles it on/off. Sell-only items (non-purchasable) or unlock-only items (no economy) result in a cleaner exported JSON.

Wizard#

No wizard of its own. Seeded by:

  • 🎒 Items (together with Inventory)
  • ⚔️ Items with Effect (together with Inventory + AttributeModifiers)

The wizard asks for a currency in the requires-dialog, and that currency becomes buyCurrencyRef + sellCurrencyRef automatically.

See also#