BAR tweakdefs Troubleshooting: Base64, modoptions, and Common Lua Mistakes
Tweakdefs and modoptions break in predictable ways. This covers the mistakes that will eat your afternoon and how to avoid them.
Extra and Scav Unit Options Cause Silent Failures
Extra and scavenger unit options get appended after tweakunits and tweakdefs are processed. If you try to remove a unit through tweakunits and the change does not appear, the extra and scav sections are likely re-adding it downstream.
The fix requires three steps. Go into alldefs.lua and locate the modoptions sections. Copy the full block for the unit you want removed, then delete it from both the main definition and the extra/scav sections. Finally, enable force load all units to ensure every unit definition is being picked up. Skip any of these steps and the removed unit sneaks back in.
Base64 modoptions Gotchas
When you paste an entire alldefs.lua into a Base64 modoptions string and try to strip entries by deletion, malformed definitions follow. Removing a single entry from a Base64 modoptions block will often break the entire string if the remaining structure has a missing comma, unclosed bracket, or orphaned table reference.
Paste the full alldefs into your Base64 editor first. Then remove the complete section for any unit you do not want, such as Epic Pawns. Verify the remaining structure parses cleanly before encoding.
Lua Table Access Patterns That Break
A rare but painful issue: var.attr = "something" occasionally yields unexpected results in Spring's Lua environment. The safer approach is var["attr"] = "something". The dot notation works most of the time, but when it fails, tracking down the cause consumes hours. Use bracket notation consistently in modding scripts to avoid this trap.
Where to Find BAR Modding Resources
Badosu's modding guide is pinned in the BAR community Discord. That guide covers the modoptions-tweakdef-tweakunits pipeline start to finish. Beyond that, the Discord pinned messages remain the most reliable reference for lobby tweak commands and Base64 configuration syntax.
Creed of Champions
Clear information and clean execution help teams improve without pointless blame. Modding knowledge spreads best when experienced players point newcomers at working resources instead of watching them struggle with broken definitions.
"Crd is the first really comfortable community I have been a part of. Everyone is nice and kind, the atmosphere is relaxed, and I am not getting yelled at for not being optimal."