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
🎒 Itemsor⚔️ 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#
| Campo | Tipo | Padrão | Descrição |
|---|---|---|---|
idYes | string | Internal ID. | |
nameYes | string | Addon name (default: Economy). | |
hasBuyConfig | boolean | Toggles the buy block on/off. Allows non-purchasable items. | |
buyCurrencyRef | string (sectionId) | Page of the currency used for buying. | |
buyValue | number | Base buy price. | |
minBuyValue | number | Price floor even with maximum discounts. | |
buyModifiers | EconomyModifierRef[] | List of globalVariables that adjust the buyValue (e.g. seasonal discount). | |
hasSellConfig | boolean | Toggles the sell block on/off. | |
sellCurrencyRef | string (sectionId) | Currency received on sale (usually the same as the buy currency). | |
sellValue | number | Base sell value. | |
maxSellValue | number | Sell ceiling even with maximum bonuses. | |
sellModifiers | EconomyModifierRef[] | globalVariables that increase/decrease sellValue. | |
hasProductionConfig | boolean | Toggles production on/off. Item produces X units per interval. | |
producedItemRef | string (sectionId) | Item this page produces when placed (e.g. a chicken produces eggs). | |
produceMin | number | Minimum amount produced per cycle. | |
produceMax | number | Maximum amount produced per cycle. | |
productionTimeSeconds | number | Interval between cycles. Accepts decimals. | |
hasUnlockConfig | boolean | Toggles unlock gate on/off. | |
unlockRef | string (sectionId) | Currency used to unlock. | |
unlockValue | number | How much it costs to unlock for the first time. | |
notes | string | Free-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.