Tags: modding, bar, beyond-all-reason, lua-widgets, bos2lua, cloaking
BAR Modding Notes: Lua Widgets, BOS Conversion, and Cloak Popups
Practical modding tips from the BAR community — installing LuaUI widgets, converting BOS files, and where to find working reference implementations.
Installing a cloak popup widget
Want to know when cloakable units are building near you? Drop a LuaUI widget for it. Grab the widget file, paste it into <BAR_DATA_FOLDER>/LuaUI/Widgets/unit_auto_cloak_popups.lua, then edit line 15 to specify which unit definitions trigger popups. For example:
local cloakingUnitDefs = {[UnitDefNames["armpb"].id]=true, [UnitDefNames["armamb"].id]=true, [UnitDefNames["armferret"].id]=true}
Hit /luaui reload or restart the game. That's it. You'll get notifications when those specific stealth units start constructing.
Stop writing BOS by hand
BOS scripts make modders suffer. There's a converter at packages.springrts.com/bos2lua that translates BOS animation scripts into Lua. Use it. The community already moved most units away from BOS — high-profile rewrites like the Marauder conversion from LUS to COB show the direction the codebase is heading. BOS is legacy at this point.
Find suggestions in the forums
The SpringRTS forums at springrts.com/phpbb are where modders post suggestions and workarounds that never make it into the wiki. If you're stuck on a specific implementation problem, search the forum before asking in chat. Someone has probably already worked through your edge case.
Creed
Knowledge sharing in the BAR modding scene reflects the community's cooperative spirit:
"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."