Skip to content

Other Options

Options not covered elsewhere.

Option Supported Types
discard - all Basic Types but l10n
- not supported in tree-structured data
pubtype explicit and implicit object types
presence tree-structured data
asL10n tree objects ({})
addPrefix, stripDir, replaceExt path
scale float, float32, float64
crude ref, backref, backref-n
e bitflags
Option Description
discard Drop a field from the output but still validate it View
pubtype Specify a named public type for an object during code generation View
presence Control what happens when a tree field is absent View
asL10n Treat values inferred as string in a tree object’s subtree as l10n View
addPrefix, stripDir, replaceExt Transform path values during data export View
scale Scale floating-point values by a configured factor during data export View
crude Generate a reference field as a plain integer or string View
e Assign an enum item to a bitflag column View

The discard option drops a field from the output.

discard → equivalent to discard=true
discard=true

The field still goes through all validation steps, from its type’s built-in checks to options.

See Option Applicability for the types this option supports.

The pubtype option specifies a named public type for an object during code generation.

pubtype=MyTypeName

It does not name the field it is set on. Instead, Archmage walks up the type tree from that field to the first enclosing object — whether explicit (such as >>object) or implicit (such as elements of **[], or objects formed by Dotted Names) — and uses that object as the target for pubtype. So pubtype=MobAttrs set on mob.hp names the implicit mob object, not the hp field.

When two fields give their enclosing objects the same pubtype, those objects must have the same structure; a mismatch causes an error. This allows identically structured objects to share a single type definition, whether they reside in the same file or in different files.

In a spreadsheet, if an object has only object fields, you cannot directly give that object a pubtype. For example, if mob contains only mob.base.hp and mob.bonus.hp, then setting a pubtype on mob.base.hp targets mob.base, not mob. To give mob a pubtype, add a placeholder field such as mob.type_ and set the pubtype on that field.

The presence option controls what happens when a field is absent from the tree-structured data.

presence=<implicit|optional|required>
Value Behavior
implicit Fill an absent field with its default export value or zero value
optional Allow the field to be absent, with no filling
required Report an error when the field is absent

The default value is implicit. The --presence CLI flag overrides this default.

A presence setting propagates to every child node in the subtree. A setting on a parent node governs all descendants unless a lower level overrides it.

The asL10n option applies only to tree objects. When enabled, every value in the object’s subtree whose type is inferred as string is treated as l10n instead. If the data type of a string value is set explicitly, that type is preserved.

__meta__:
type: "{}"
options:
asL10n: true
loadGame: Load Game
settings: Settings
quitConfirm: Quit now? Your progress is safe. Your legend, less so.

These options transform path values during data export: add a directory prefix, strip directory segments, or replace the file extension.

See addPrefix, stripDir, and replaceExt for full documentation.

The scale option scales floating-point values by a configured factor during data export.

See scale for full documentation.

The crude option generates a reference field as a plain integer or string instead of a rich reference that links to the target config entry at runtime. It applies to ref, backref, and backref-n.

crude → equivalent to crude=true
crude=true

The e option adds an enum item as a configurable flag to a bitflag field.