Progression Tree Builder

v1.3.0

Item & Currency Costs

Optional GC2 Inventory item/currency skill costs and the Inventory Bridge.

Item / Currency Costs

On top of its normal skill point cost, a skill can additionally require items and/or a currency amount from the target character's Game Creator 2 Bag. This is entirely optional — both cost lists default to empty, so existing skills and projects that don't use GC2 Inventory are completely unaffected.

Needs the GC2 Inventory module and the Inventory Bridge enabled (see below). Without the bridge enabled, a skill with item/currency costs still unlocks for free.

Setting Costs

Set itemCosts / currencyCosts on the skill node via Graph Editor → node → Edit All Properties → "Item / Currency Costs".

FieldTypeDescription
itemCostsList<ItemCostEntry>Items required from the character's GC2 Bag. Each entry is a Unique ID string (matching the Item asset's own Unique ID) plus an amount.
currencyCostsList<CurrencyCostEntry>Currency amounts required from the character's GC2 Bag. Each entry is a Unique ID string (matching the Currency asset's own Unique ID) plus an amount.

Each entry is a Unique ID string (matching the Item/Currency asset's own Unique ID in GC2 Inventory) plus an amount.

Inventory Bridge

Enforcement of item/currency costs needs the optional Inventory Bridge — an assembly (Runtime/Bridges/Inventory) that only compiles when the PTB_INVENTORY_BRIDGE define is active and GameCreator.Runtime.Inventory is present. It is auto-disabled otherwise by PTBBridgeValidator.

Enabling the Bridge

  1. Set Item Costs / Currency Costs on the skill node: Graph Editor → select node → Edit All Properties → "Item / Currency Costs"
  2. Enable the Inventory Bridge: Window → Progression Tree Builder → Bridges → Inventory Bridge
  3. Unity recompiles with the PTB_INVENTORY_BRIDGE define active

Behavior

SituationResult
Skill has no item/currency costsUnchanged — only the skill point cost applies
Skill has costs, bridge enabledUnlock Skill checks the Bag via ISkillCostProvider.CanAfford, deducts via Deduct
Skill has costs, bridge not enabledTreated as affordable, nothing deducted, one warning per skill in the log
Never locks the player out: if the bridge isn't enabled — or GC2 Inventory isn't installed at all — skills with item/currency costs are treated as affordable and unlock normally. Only a warning is logged, once per skill.

Custom Cost Sources

Don't use GC2 Inventory, or want to charge from your own item/currency system instead? Assign your own provider to SkillCostProviderRegistry.Provider by implementing ISkillCostProvider.

public interface ISkillCostProvider
{
    bool CanAfford(ProgressionSkill skill, GameObject target);
    void Deduct(ProgressionSkill skill, GameObject target);
}

Public API

  • ProgressionSkill.HasItemOrCurrencyCosts() → bool
  • ProgressionTreeBuilder.Runtime.Core.ISkillCostProvider
  • SkillCostProviderRegistry.Provider — assign your own provider to support a non-Inventory item system