Weapon schema
One weapon per TOML file under a content pack's content/weapons/. A unit
fires it by listing <mod-id>.<weapon-id> in its weapons
(UNIT_SCHEMA.md). What the loader does with it, and what
it does not: ../README.md. The weapon TDF
field named in each table is the TA field the value corresponds to.
Fields
| Field | Type | Rule | Weapon TDF |
|---|---|---|---|
id |
string | Required, Identifier Rules. | section name |
name |
string | Required, non-empty. | name |
description |
string | ||
damage |
integer | Non-negative. The same damage against every target. | [DAMAGE] default |
range |
number | Non-negative, world units. | range |
reload_seconds |
number | Non-negative, seconds between shots. | reloadtime |
velocity |
number | Non-negative, projectile speed in world units per second. | weaponvelocity |
delivery_type |
string | projectile or beam. |
beamweapon (beam = 1) |
A weapon that leaves out damage (and [damage_profile]), range or
velocity gets AEX's own defaults for native content: 50 damage, range 200
and velocity 300. These are not TA's absent-key values, which only apply to
TA weapon TDF files.
[damage_profile]
Damage that differs by target. When it is present, damage is not used.
| Field | Type | Rule | Weapon TDF |
|---|---|---|---|
default |
integer | Non-negative. Damage against a category not overridden. | [DAMAGE] default |
overrides.<category> |
integer | Non-negative. <category> is a bare armor category id. |
[DAMAGE] <armor class> |
When the pack has content/armor_categories.toml, every override key must
be one of its categories; without one, keys are free labels
(ARMOR_TARGET_CATEGORY_SCHEMA.md).
[special_behavior.paralyzer]
Makes the weapon a paralyzer: it stuns instead of dealing damage.
| Field | Type | Rule | Weapon TDF |
|---|---|---|---|
duration_seconds |
number | Required in the section, non-negative. | paralyzer = 1, paralyzetime |
A paralyzer that also sets damage or [damage_profile] is an error.
Reserved names
These are errors in a weapon file: the top-level sections [projectile],
[effects] and [targeting], and the subsections
[special_behavior.splash], [special_behavior.commandfire],
[special_behavior.per_shot_resource] and [special_behavior.death].
Examples
Flat damage:
id = "light-laser"
name = "Light Laser"
damage = 10
range = 150.0
reload_seconds = 1.5
delivery_type = "beam"
Damage by armor category (uh-sample-pack/content/weapons/pulse-laser.toml):
id = "pulse-laser"
name = "Pulse Laser"
range = 180.0
reload_seconds = 1.2
delivery_type = "beam"
[damage_profile]
default = 12
[damage_profile.overrides]
armored = 6
light = 15
aircraft = 4
Paralyzer (uh-sample-pack/content/weapons/emp-blast.toml):
id = "emp-blast"
name = "EMP Blast"
range = 220.0
reload_seconds = 5.0
delivery_type = "projectile"
[special_behavior.paralyzer]
duration_seconds = 6.0