BAR tweakdefs troubleshooting: when your changes break silently

Common reasons tweakdefs fail, how to fix them, and why extra modoptions matter.

Tags: bar modding, tweakdefs, modoptions, base64, Lua errors

The silent failure problem

The hardest part of BAR tweakdefs debugging is that mistakes rarely crash the game. They just do nothing. You paste Base64 into the lobby, press enter, and the units behave exactly as before. No error message. No warning. This is the most common complaint from new modders.

Extra and scav modoptions interfere

A frequent gotcha: extra and scavenging unit options get added after tweakunits and tweakdefs run. If you are trying to remove a unit via a tweak command, but that unit also lives in the extramodoptions or scavenge options, your removal gets overwritten. The fix requires finding those modoptions sections in alldefs_post, copying and removing the unit from there, and enabling "force load all units" in the lobby settings.

Tracking down the broken line

A specific Lua quirk that catches people: assigning to var.attr on a local variable can produce unexpected behavior even when var["attr"] works fine. If a tweakdef works sometimes but fails on specific unit entries, this subtle Lua behavior is worth checking. The dot notation and bracket notation are not always interchangeable on dynamically constructed tables.

Where to find the modding guide

Badosu's modding guide lives in the pinned messages of the community modding channel. It covers the basics of tweakdefs, tweakunits, and modoptions setup. When starting out, read that guide first, then use the Spring RTS Lua_UnitDefs wiki for specific property references. Those two resources cover most beginner questions without needing to search through chat logs.

Learning modding with a team

Modding BAR works best when the people testing your changes communicate clearly. Creed of Champions runs an environment where players give honest feedback without blaming each other for broken tweaks or unbalanced configs. That kind of cooperative testing speeds up the whole process.

[Crd] Everyone is nice and kind, the atmosphere is relaxed, and I am not getting yelled at for not being optimal.