Why some base64 encoders break tweakdefs code, how to filter out incomplete units from Lua queries, and finding clear HP bar mods.
Some base64 encoding websites produce output that works with BAR tweakdefs and others do not. The difference comes down to character encoding defaults. One popular encoder adds padding or uses standard base64 characters that the spring lobby parser does not accept. Another produces URL-safe output by default.
Modders who hit silent failures when pasting encoded tweak strings should try a different encoder with URL-safe format enabled. The encoded string itself is not wrong. The character set is just incompatible with what BAR expects.
Def tweaks also do not support greater-than or less-than comparisons. The tweak system applies value replacements, not conditional logic. Any comparison needs to happen in the Lua widget or script layer, not in the tweakdef itself.
When iterating through UnitDefs or querying unit state, players often want to filter out units still under construction. The solution is GetUnitHealth from the spring synced read API. The last parameter returned by GetUnitHealth is the construction progress as a fraction. A value below 1 means the unit is not yet complete.
Custom params like unit.customParams.unitgroup help categorize units into metal, energy, or other groups. Combining GetUnitHealth checks with customparam filters gives modders precise control over which units appear in queries.
Example: a widget that lists all extractors should skip any extractor with GetUnitHealth returning less than 1 for the build fraction. The extractor exists in UnitDefs from the moment construction starts, but is not operational until the build completes.
Players who want better visibility on health bars have widget options. Community-built HP bar mods replace the default display with larger, higher-contrast bars that are readable at a glance during fast fights.
These mods typically live in the BAR community channels and get shared as widget files. Installation follows the standard BAR widget process: place the Lua file in the widgets directory and enable it in the widget selection screen.
BAR modding tools are only as reliable as the details they handle. URL-safe base64 encoding, proper build-completion checks, and clear information displays all reduce friction for players and modders alike. Test with the right tools, filter with the right APIs, and the rest works itself out.
"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."
Creed of Champions member