Subtable Types
Subtable types define embedded subtables within a regular table. For each config entry, a subtable spans multiple rows and columns, where each row maps to a single object (for **[], **[N]) or a key-object pair (for **map).
Type Availability
Section titled “Type Availability”| Category | Regular Table | Property Sheet | Tree-Structured Data |
|---|---|---|---|
| Subtable Types | ✓ |
Type List
Section titled “Type List”| Type | Description | |
|---|---|---|
**[] |
Subtable array | View |
**[N] |
Fixed-size subtable array | View |
**map |
Subtable map | View |
Before configuring subtables, add the following rows to Superheader:
| Label | Description |
|---|---|
| Subtable Description | A human-readable description with no functional effect on data export or code generation. Use - when no description is needed. Can be abbreviated as Subtable Desc. |
| Subtable Name | The subtable’s identifier, used in exported data and generated code; changing it affects all downstream output. |
| Subtable Type | The subtable’s data type and its default export value, e.g., **[]=/. |
Common Rules
Section titled “Common Rules”- Columns forming a subtable share a common subtable name.
- Fields of subtable objects must be of Basic Types, Compact Types, Multi-Column Types, or specific Behavior Types (
assert,placeholder). - Fields of subtable objects are defined in the regular Description, Type and Name rows below the subtable definition. They may define their own default export values.
Filling Subtable Data
Section titled “Filling Subtable Data”For each config entry:
- A subtable may span multiple rows; non-subtable fields use only the first row, and remaining rows must stay blank.
- Separate subtables are independent and do not interact.
See Also
Section titled “See Also”For each config entry, a subtable of the subtable array type (**[]) embeds a variable-length array of objects. It spans multiple rows and columns. All columns involved share a common subtable name.
| Subtable Desc | Hero skills | ||
| Subtable Name | skills | ||
| Subtable Type | **[]object | ||
| Desc | Hero name | Skill name | Skill damage |
| Name | name | name | damage |
| Type | string | string | int |
| 1 | Arthur | slash | 5 |
| thrust | 8 | ||
| 2 | Lancelot | guard | 3 |
{ "1": { "name": "Arthur", "skills": [ { "name": "slash", "damage": 5 }, { "name": "thrust", "damage": 8 } ] }, "2": { "name": "Lancelot", "skills": [ { "name": "guard", "damage": 3 } ] }}Type Definition Syntax
Section titled “Type Definition Syntax”**[] → equivalent to **[]object**[]objectBlock Layout
Section titled “Block Layout”For each config entry, a subtable occupies a block of cells. Each row in the block maps to a single object. The block may contain any number of rows.
Default Export Value
Section titled “Default Export Value”**[] → no default export value**[]=/ → null**[]={} → empty array []See Default Export Value for more information.
Export Format
Section titled “Export Format”On data export, Archmage emits an array of objects.
Related Types
Section titled “Related Types”For each config entry, a subtable of the fixed-size subtable array type (**[N]) embeds a fixed-size array of objects. It spans multiple rows and columns. All columns involved share a common subtable name.
| Subtable Desc | Elemental resist | ||
| Subtable Name | resist | ||
| Subtable Type | **[2]=/ | ||
| Desc | Monster | Element | Value |
| Name | name | element | value |
| Type | string | string | int |
| 1 | Dragon | fire | 80 |
| ice | 30 | ||
| 5 | Slime | ||
| # | |||
{ "1": { "name": "Dragon", "resist": [ { "element": "fire", "value": 80 }, { "element": "ice", "value": 30 } ] }, "5": { "name": "Slime", "resist": null }}Type Definition Syntax
Section titled “Type Definition Syntax”**[N] → equivalent to **[N]object**[N]objectBlock Layout
Section titled “Block Layout”For each config entry, a subtable occupies a block of cells. Each row in the block maps to a single object. The block must contain exactly N rows.
Default Export Value
Section titled “Default Export Value”**[N] → no default export value**[N]=/ → null**[N]={} → array of N elements, each being null**[N]={}{} → array of N zero-valued objectsThe default export value also determines how Archmage handles a blank row.
With / or {}, the result is null; with {}{}, it is a zero-valued object.
See Default Export Value for more information.
Export Format
Section titled “Export Format”On data export, Archmage emits an array of N objects.
Related Types
Section titled “Related Types”For each config entry, a subtable of the subtable map type (**map) embeds an object map. It spans multiple rows and columns. All columns involved share a common subtable name.
| Subtable Desc | Loot table | |||
| Subtable Name | loot | |||
| Subtable Type | **map={} | |||
| Desc | Chest | Item | Count | Chance |
| Name | name | $$ | value | chance |
| Type | string | string | int | float |
| 2 | Gold chest | gold | 100 | 0.8 |
| gem | 5 | 0.2 | ||
| 3 | Empty chest | |||
{ "2": { "name": "Gold chest", "loot": { "gold": { "value": 100, "chance": 0.8 }, "gem": { "value": 5, "chance": 0.2 } } }, "3": { "name": "Empty chest", "loot": {} }}Type Definition Syntax
Section titled “Type Definition Syntax”**mapEvery subtable map requires a key column. As with object fields, the map key is defined in the regular Description, Type and Name rows below the subtable definition.
The $$ token in the Name row identifies the map key. Its type must be string, an integer type, or an enum type. It cannot have options or a default export value.
Block Layout
Section titled “Block Layout”For each config entry, a subtable occupies a block of cells. Each row in the block forms a key-object pair: the $$ column supplies the key, and the remaining columns form the object. The block may contain any number of rows.
Default Export Value
Section titled “Default Export Value”**map → no default export value**map=/ → null**map={} → empty map {}**map={}{} → empty map {}The default export value also determines how Archmage handles a blank value row.
With / or {}, the result is null; with {}{}, it is a zero-valued object.
See Default Export Value for more information.
Export Format
Section titled “Export Format”On data export, Archmage emits an object map.