ItemData

Serializable data record holding the definition of an item type. Extends FactorableData from the Scriptable Factory system and provides fields used by Item during initialization.

Definition

Namespace: Paragon.Townskeep.ItemSystem Assembly: Townskeep.dll

[Serializable]
public record ItemData : FactorableData

Inheritance: FactorableData → ItemData

Remarks

ItemData is a C# record (value equality semantics) that serves as the data payload for the item factory pipeline. When an Item is spawned, InitializeData(ItemData) copies fields from this record into the item's runtime state.

Fields marked with [Overridable] can be overridden per variant in the Scriptable Factory variant system. This means a base item definition can have its Name, Icon, Value, or VariantID customized per variant without duplicating the entire data record.

The InteractionTable field configures which interactions are available when the item is placed in the world (e.g., pick up, inspect, use).

Quick Lookup

Goal
How

Define a new item type

Create an ItemFactory<T, TData> ScriptableObject with ItemData

Override per variant

Mark fields with [Overridable] attribute

Set item price

Assign Value field (type Coin)

Configure interactions

Assign InteractionTable field

Fields

ItemID

Unique integer identifier for this item type within the ItemDatabase.

VariantID

Variant index within the factory. Marked [Overridable] and [HideInInspector] — set automatically by the variant system.

Name

Display name of the item. Marked [Overridable] for per-variant customization.

Icon

Sprite displayed in inventory UI and tooltips. Marked [Overridable] for per-variant customization.

Value

Monetary value of the item as a Coin. Marked [Overridable] for per-variant pricing. Defaults to 0.

InteractionTable

The InteractionTable defining which interactions are available when this item is placed in the world.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

See Also

  • ItemID — composite type/variant identifier struct

  • Item — runtime MonoBehaviour consuming this data

  • ItemFactory — factory that holds and applies this data

  • ItemDatabase — registry of all item factories

  • Coin — currency type used for Value

  • InteractionTable — interaction configuration

Last updated