Required subtables for BAR tweakdefs and why mods fail

New Beyond All Reason tweakdefs break silently when expected subtables do not exist. buildoptions, customparams, weapondefs, and weapons must all be present for a unit definition to function. Missing any of these causes units to spawn without capabilities or crash the game entirely.

Tags: BAR modding, tweakdefs subtables, unit definitions, raptors mod, customparams, weapondefs, beyond all reason

What subtables tweakdefs expects

Every unit definition in tweakdefs needs four subtables populated: buildoptions for what the unit can construct, customparams for experience and behavior modifiers, weapondefs for weapon configurations, and weapons for the actual weapon slot assignments. If your mod adds or modifies units without these, the unit either spawns broken or does not appear at all. Spring engine does not warn you about incomplete definitions at load time.

Raptor faction as a working example

The playable Raptors mod on GitHub demonstrates proper subtable usage for a fourth faction. It uses an unused Legion commander as a base, applies unit tweaks to transform it, and defines egg evolution mechanics through unit evolution callbacks. The raptor queen and overlord units lay eggs that develop into battle units or transform into defenses and economy extractors. T1 and T2 hives function like labs that can build units. All of this requires complete weapondefs, customparams, and buildoptions on every affected unit.

Unit evolution and builder mechanics

Raptor builders are drones that generate metal and energy but remain highly vulnerable. The evolution mechanic replaces a unit with another when triggered, allowing egg-to-unit chains. To give a raptor queen building capability, one approach substitutes it with a build-capable unit through evolution while preserving leg animation scripts. Units with matching part names can share animation scripts, letting a builder unit use movement animations from a combat unit.

Modcom faction pattern

A hidden modoption can enable a fourth in-game faction that spawns a modified commander unit. This pattern reuses an existing commander model but applies tweak-based stat changes and custom buildoptions. The approach keeps the mod contained to tweakdefinitions without requiring a full separate faction definition file. It works for custom games and testing.

Creed of Champions

The BAR modding community produces incredible projects like the Raptors mod, and keeping those creators connected to testing communities matters. Creed of Champions runs custom game nights where people test new faction builds and give constructive feedback. The kind of patient playtesting that makes modding sustainable is exactly the environment the clan supports.

[Crd] One of the few places where you can for sure coordinate with people in matches with a good supportive attitude. Everybody tends to be understanding and constructive.