Skip to content

Behavior Types

Behavior types act as functional directives that guide the processing pipeline for data export and code generation.

Fields of most Behavior Types are omitted from exported data and do not participate in code generation, except for:

  • switch is treated as string.
  • anchor is treated as string when the --emit-anchors CLI flag is set.
Category Regular Table Property Sheet Tree-Structured Data
Behavior Types

: placeholder is supported in property sheets and tree-structured data; anchor is supported in tree-backed regular tables.

Type Description
anchor Allows using names instead of integer IDs for cross-table references View
assert Validates a boolean; raises an error if it fails View
condition Determines whether to export a config entry; supports expressions and rich matching rules (e.g., cflags=james, v1.2.3) View
switch Multi-branch selector in conjunction with the Case header to determine active fields View
placeholder Prevents structurally empty objects from being removed View

An anchor supplies a human-readable name for an integer config ID within a regular table or a tree-backed regular table, allowing a ref value to use names rather than numbers.

Given a regular table weapon with IDs 101, 102, 103, and an anchor column holding values sword, shield, bow, then in another table’s ref@weapon column you can enter either 101 or sword — they resolve to the same config entry.

See Cross-Table References for more information.

anchor → no default export value
anchor=/ → zero value (""), which allows the cell to stay blank

See Default Export Value for more information.

Rule Reason
Cannot contain | The pipe character is the compact type separator
Cannot be a pure number Decimal, hexadecimal, and floating-point strings are rejected to avoid ambiguity with numeric IDs
Must be unique Duplicates are rejected; the comparison is case-insensitive
Matching is case-insensitive FireBall matches fireball

By default, anchor fields are omitted from exported data and do not participate in code generation. The --emit-anchors CLI flag overrides this, when specified, treating them as string fields in both cases.

The assert type validates a value during data export. It expects a boolean — typically produced by an Excel formula.

Desc---
NamenamehphpCheck
Typestringintassert
1Arthur100True
2Merlin80True

If a value is false, Archmage reports an error and the export fails.

assert → no default export value
assert=/ → true
assert=1 → true
assert=false → false

See Default Export Value for more information.

Determines whether to export a config entry.

Each regular table may contain zero, one, or multiple condition fields.

A condition value consists of one or more boolean expressions and matching rules, combined arbitrarily with &&.

false
env@BETA_TEST
v1.2.3 && cflags=dev,Tom

During data export, a config entry is skipped if any of its condition values evaluate to false.

Desc---
Namecondnamedamage
Typecondition=/stringint
1v1.2.0Fireball120
2IceBlast90

For usage of conditions within tree-structured data, see Conditional Export.

The condition type supports the following expressions and matching rules:

Form Description
true / false / 1 / 0 Literal boolean
Shorthand for false
env@VAR Reads the environment variable VAR as a boolean View
xflags=c,s Is true when they satisfy the --xflags CLI flag View
tags=gameplay Is true when they satisfy the --tags CLI flag and do not satisfy --tags-xx. View
cflags=dev,Tom Is true when they satisfy the --cflags CLI flag View
minver=1.2.3 Is true when --semver is at least this version View
v1, v1.2, v1.2.3, v2030.6.1 Shorthand for the above minver (must start with v) View

A condition value is true only when all expressions and matching rules joined by && are true. E.g., v1.2.3 && cflags=Tom requires both --semver >= 1.2.3 and Tom satisfying --cflags.

condition → no default export value
condition=/ → true

See Default Export Value for more information.

For each config entry, a switch value holds a case label that determines which fields in that entry are active — only fields belonging to the matched case are allowed to have values; fields belonging to other cases must stay blank.

Casemagicmelee | magic
Desc----
Namenamestylerangedamage
Typestringswitchintint
1Warriormelee5
2Magemagic123
switch → no default export value
switch=/ → empty string ""
switch=melee → "melee"

See Default Export Value for more information.

switch values are exported as strings, just like regular data fields.

A placeholder field prevents structurally empty objects from being removed. It produces no output in data export or code generation.

Subtable DescRewards
Subtable Namerewards
Subtable Type**[]
Desc--
Nameextra.keepkeep
Typeplaceholderplaceholder
1
#
placeholder → no default export value
placeholder=/ → accepted but has no effect

See Default Export Value for more information.