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.
Type Availability
Section titled “Type Availability”| Category | Regular Table | Property Sheet | Tree-Structured Data |
|---|---|---|---|
| Non-Leaf Types | ✓ |
Type List
Section titled “Type List”| 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 |
Common Rules
Section titled “Common Rules”- By default, element types of
[],[N], andmap, 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:
/exportsnull;{}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
presenceoption; an error occurs only whenpresenceis set torequiredexplicitly.
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 - potionloot__meta__: type: "[]" elem: type: string{ "loot": ["sword", "shield", "potion"]}Type Definition Syntax
Section titled “Type Definition Syntax”[]Default Export Value
Section titled “Default Export Value”[] → no default export value[]=/ → null[]={} → empty array []See Default Export Value for more information.
Related Types
Section titled “Related Types”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 - 0tint__meta__: type: "[3]"{ "tint": [255, 128, 0]}Type Definition Syntax
Section titled “Type Definition Syntax”[N]N must be a positive integer.
[1][2][5]Default Export Value
Section titled “Default Export Value”[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.
Related Types
Section titled “Related Types”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: 10cost__meta__: type: "map[string]"{ "cost": { "gold": 100, "gems": 50, "energy": 10 }}Type Definition Syntax
Section titled “Type Definition Syntax”mapmap[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.
mapmap[string]map[int]map[enum@attribute]Default Export Value
Section titled “Default Export Value”map → no default export valuemap=/ → nullmap={} → 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: trueprofile__meta__: type: "{}"{ "profile": { "name": "Elena", "level": 42, "active": true }}Type Definition Syntax
Section titled “Type Definition Syntax”{}Default Export Value
Section titled “Default Export Value”{} → no default export value{}=/ → null{}={} → zero-valued object (all fields populated with their respective zero values)See Default Export Value for more information.
minmax
Section titled “minmax”A tree minmax represents a min–max pair. This type applies to {} nodes. The fixed fields are min and max.
damage: min: 10 max: 50damage__meta__: type: "minmax|int"{ "damage": { "min": 10, "max": 50 }}Type Definition Syntax
Section titled “Type Definition Syntax”minmax|TT must be an integer type, a floating-point type, or duration.
minmax|intminmax|float32minmax|int64minmax|durationDefault Export Value
Section titled “Default Export Value”minmax|int → no default export valueminmax|int=/ → {min: 0, max: 0}minmax|int={} → {min: 0, max: 0}See Default Export Value for more information.
wtpool
Section titled “wtpool”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: 60drops__meta__: type: "wtpool|string"{ "drops": { "items": ["sword", "shield", "potion"], "weights": [10, 30, 60] }}Type Definition Syntax
Section titled “Type Definition Syntax”wtpool|TT 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|stringwtpool|intwtpool|{}Default Export Value
Section titled “Default Export Value”wtpool|int → no default export valuewtpool|int=/ → nullwtpool|int={} → empty pool {items: [], weights: []}See Default Export Value for more information.
Export Format
Section titled “Export Format”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.
vector
Section titled “vector”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: -50spawn__meta__: type: "vector|3|float32"{ "spawn": {"x": 100, "y": 0, "z": -50}}Type Definition Syntax
Section titled “Type Definition Syntax”vector|Dim|TDim must be 2, 3, or 4; T must be an integer or a floating-point type.
vector|2|intvector|3|float32vector|4|int32Default Export Value
Section titled “Default Export Value”vector|3|float → no default export valuevector|3|float=/ → {x: 0, y: 0, z: 0}vector|3|float={} → {x: 0, y: 0, z: 0}See Default Export Value for more information.
Field Names
Section titled “Field Names”Dim |
Fields |
|---|---|
2 |
x, y |
3 |
x, y, z |
4 |
x, y, z, w |