Want to test balance changes or adjust unit health for custom games in Beyond All Reason? tweakunits commands and modoptions let you modify stats without editing core unit files. The trick is knowing which tables to target and avoiding nil crashes.
Tags: BAR tweakunits, modoption, customparams, unit health, maxdamage, balance testing, beyond all reason
Unit health in BAR unitdefs is stored as maxdamage. To change a unit's health during a custom game, target maxdamage through twistunits or a lobby tweak script. The tick unit, internally named armflea in Arm side code, responds to the same pattern as any other unit. Reference implementations exist in community gist repositories. Replace the unit name in any existing script to target different units.
Not every unit has a customparams table by default. If you iterate all UnitDefs and write to ud.customparams without checking, some units throw nil errors. Guard the access: verify customparams is not nil before assigning to subkeys like rangexpscale. This catches modders off guard constantly because most units do have customparams, but exceptions exist and they crash hard.
The rangexpscale parameter in customparams controls how much experience a unit gains. Loop through UnitDefs and set ud.customparams.rangexpscale to a value like 0.6 to reduce XP gain globally. This works for custom games where you want faster or slower unit progression. Use pairs iteration and the customparams check mentioned above.
Some air units like the Legion assistdrone attempt to land between actions. If you want an air unit to stay permanently flying, the control typically lives in a widget rather than unitdefs. The flight behavior is client-side logic, not something set through a simple unitdef flag. Modding landing behavior requires checking the widget that handles aircraft state transitions or creating a client-side override widget.
Players have shared lobby tweak code that enables experimental faction setups. The Legion modoption must be enabled to unlock Legion faction units. Pasting the relevant code blocks into the lobby chat before game start applies the tweaks immediately. This works for basic testing without committing to a full mod installation.
Tinkering with game balance is how a lot of players understand BAR at a deeper level. Creed of Champions encourages that kind of curiosity. The clan runs custom games where people test unusual setups and learn from the results. Good balance discussion happens when people experiment together instead of fighting about it in ranked lobbies.
[Crd] The removal of toxicity, the goal of fun and learning, makes for a refreshing spot to play and spend time. It has also made a game with plenty of complexity a bit less daunting to dive into.