GetActiveCompanionDefId
ESO Lua API function — used by 31 of the 3,030 addons we indexed (combined 5,262,228 downloads). Signature from the official ESOUIDocumentation.txt, API version 101050.
Official signature
GetActiveCompanionDefId()Returns: integer activeCompanionDefId
Real usage — from Inventory Insight
if HasActiveCompanion() then
return ZO_CachedStrFormat(SI_UNIT_NAME, GetCompanionName(GetActiveCompanionDefId()))
-- returns nil if no current active companionShort excerpt from the shipping addon Inventory Insight — its ESOUI page; the code belongs to its author. Shown because documentation without a working example is half a reference.
Most-downloaded addons using it
| Addon | Total downloads |
|---|---|
| Inventory Insight | 2,763,446 |
| WPamA (What Pledges at my Alts) | 735,283 |
| OdySupportIcons - Group Role Icons & More | 484,590 |
| Bar Steward - Multi Toolbar | 204,140 |
| Bandits Companions and Pets | 192,393 |
| SuperStar - Seasonal Update | 178,124 |