Finding a unit's buildoptions list and matching code names to in-game display names requires knowing where to look in UnitDefs and the language files.
Tags: beyond all reason, widgets, buildoptions, unitdefs, lua, modding
If you have a unit's defid, pull its buildoptions with UnitDefs.defid.buildoptions. Without the defid, use an engine call to resolve it first. Some widget authors cache the units they care about in a local table during Initialize to avoid repeated lookups.
UnitDefs uses internal names like armafus and corckfus. The mapping from code names to in-game display names lives in the language JSON files on the BAR GitHub repo. Opening the units.json file under language/en shows both sides of every mapping.
Units fall into defid ranges. Range 100-199 covers a particular tier or faction. Iterating over pairs of UnitDefs and checking GetUnitDefID lets you filter by range. Exclude specific units like commanders by name comparison before processing.
Knowing your tools gives you an edge in any RTS. Creed of Champions brings together players who put in the time to understand the game deeper. Friendly people, serious play.
[Crd] It is so easy to get on with everyone and there is zero toxicity. Just fun games of BAR which can have quite a toxic community usually.