Skip to content

Non-Leaf Types

Non-leaf types apply exclusively to [] or {} tree-structured data nodes, determining how Archmage processes these nodes and their children.

See Meta Nodes for how to set the data type for a node.

Category Regular Table Property Sheet Tree-Structured Data
Non-Leaf Types
Type Description Target Node
[] Tree array [] View
[N] Fixed-size tree array [] View
map Tree map {} View
{} Tree object {} View
minmax Tree minmax {} View
wtpool Tree weighted pool [] View
vector Tree vector {} View
  • By default, element types of [], [N], and map, as well as field types of {}, are inferred from child data nodes — they are not part of the type definition.
  • Two default export value shorthands are supported: / exports null; {} exports an empty container or a zero-valued object.
  • When no default export value is set, whether a missing node triggers an error is controlled by the presence option; an error occurs only when presence is set to required explicitly.

A tree array represents a variable-length array. This type applies to [] nodes. The element type is determined by its child data nodes or by __meta__.elem.type.

loot:
- sword
- shield
- potion
loot__meta__:
type: "[]"
elem:
type: string
[]
[] → no default export value
[]=/ → null
[]={} → empty array []

See Default Export Value for more information.

A fixed-size tree array — exactly N elements. This type applies to [] nodes. The element type is determined by its child data nodes or by __meta__.elem.type.

tint:
- 255
- 128
- 0
tint__meta__:
type: "[3]"
[N]

N must be a positive integer.

[1]
[2]
[5]
[3] → no default export value
[3]=/ → null
[3]={} → array with N zero-valued elements (e.g., [0, 0, 0])

See Default Export Value for more information.

A tree map represents a collection of key-value pairs. This type applies to {} nodes. The value type is determined by its child data nodes or by __meta__.elem.type.

cost:
gold: 100
gems: 50
energy: 10
cost__meta__:
type: "map[string]"
map
map[K]

The bare map form leaves the key type unspecified; Archmage infers it from the data — if all keys are integers, the key type resolves to int.

The map[K] form specifies the key type explicitly. K must be string, an integer type, or an enum type. K cannot have any options.

map
map[string]
map[int]
map[enum@attribute]
map → no default export value
map=/ → null
map={} → empty map {}

These shorthands also apply to the map[K] form (e.g., map[string]={}).

See Default Export Value for more information.

A tree object represents a structured record. This type applies to {} nodes. Field names and their types are determined by its child data nodes.

profile:
name: Elena
level: 42
active: true
profile__meta__:
type: "{}"
{}
{} → no default export value
{}=/ → null
{}={} → zero-valued object (all fields populated with their respective
zero values)

See Default Export Value for more information.

A tree minmax represents a min–max pair. This type applies to {} nodes. The fixed fields are min and max.

damage:
min: 10
max: 50
damage__meta__:
type: "minmax|int"
minmax|T

T must be an integer type, a floating-point type, or duration.

minmax|int
minmax|float32
minmax|int64
minmax|duration
minmax|int → no default export value
minmax|int=/ → {min: 0, max: 0}
minmax|int={} → {min: 0, max: 0}

See Default Export Value for more information.

A tree weighted pool represents a sequence of item-weight pairs. This type applies to [] nodes. Each element is an object with item and weight fields.

drops:
- item: sword
weight: 10
- item: shield
weight: 30
- item: potion
weight: 60
drops__meta__:
type: "wtpool|string"
wtpool|T

T is the item type. It can be any Basic Type except for l10n, or {} (tree object).

Weights are int32 values; the data type is fixed and never needs to be specified.

wtpool|string
wtpool|int
wtpool|{}
wtpool|int → no default export value
wtpool|int=/ → null
wtpool|int={} → empty pool {items: [], weights: []}

See Default Export Value for more information.

On data export, a weighted pool becomes an object with two parallel arrays, items and weights. Each weight corresponds to the item at the same index.

A tree vector represents a geometric vector with a fixed number of named fields. This type applies to {} nodes.

spawn:
x: 100
y: 0
z: -50
spawn__meta__:
type: "vector|3|float32"
vector|Dim|T

Dim must be 2, 3, or 4; T must be an integer or a floating-point type.

vector|2|int
vector|3|float32
vector|4|int32
vector|3|float → no default export value
vector|3|float=/ → {x: 0, y: 0, z: 0}
vector|3|float={} → {x: 0, y: 0, z: 0}

See Default Export Value for more information.

Dim Fields
2 x, y
3 x, y, z
4 x, y, z, w