Home › Lua API › Units

Available out of the box. Usable from Lua in the unmodified game.

Units

12 methods. Symbol/current columns are function addresses (RVA) of the native wrapper.

Community reference for this object: Units (Sukrit Tan, external).

Signatures are recovered from the game code. ⚠ = partly understood (arguments may be missing or approximate). ? after a name = optional argument. Types: integer/number are Lua numbers, enum-typed arguments show the C++ type in brackets. Two signatures mean the method is registered separately for the UI and the gameplay state and each wrapper was decoded on its own. "same code as" in the Symbol column means the compiler merged identical functions: those methods share one wrapper and cannot be told apart by address.

Method Signature Where Reference Symbol Current
AreUnitsInPlot Units.AreUnitsInPlot(x: integer/Plot, y?: integer) → boolean
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x6c3300 0x6c39c0
AreUnitsInPlotLayerID Units.AreUnitsInPlotLayerID(x: integer/Plot, y?: integer) → boolean
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x6c33b0 0x6c3a70
GetLayerCount Units.GetLayerCount() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x6c3540 0x6c3c00
GetPlayerUnitsInPlot Units.GetPlayerUnitsInPlot(arg1: integer, x: integer/Plot, y?: integer) → Unit[]
✓ exists at runtime (not called)
ui-cache yes ↗ 0x6c3590 0x6c3c50
GetPlayerUnitsInPlotLayerID Units.GetPlayerUnitsInPlotLayerID(arg1: integer, x: integer/Plot, y?: integer) → Unit[]
✓ exists at runtime (not called)
ui-cache yes ↗ 0x6c3780 0x6c3e40
GetUnitByIndexInPlot Units.GetUnitByIndexInPlot(x: integer/Plot, y?: integer) → Unit
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x6c3aa0 0x6c4160
GetUnitCountInPlot Units.GetUnitCountInPlot(x: integer/Plot, y?: integer) → number
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x6c3b80 0x6c4240
GetUnitCountInPlotLayerID Units.GetUnitCountInPlotLayerID(x: integer/Plot, y?: integer) → number
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x6c3c30 0x6c42f0
GetUnitCountInPlotLayerIndex Units.GetUnitCountInPlotLayerIndex(x: integer/Plot, y?: integer) → number
✓ exists at runtime (not called)
ui-cache yes ↗ 0x6c3d90 0x6c4450
GetUnitsInPlot Units.GetUnitsInPlot(x: integer/Plot, y?: integer) → Unit[]
args: x — Plot index (named plotIndex / plotID in the scripts). (inferred)
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x6c3f00 0x6c45c0
GetUnitsInPlotLayerID Units.GetUnitsInPlotLayerID(x: integer/Plot, y?: integer) → Unit[]
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x6c40c0 0x6c4780
GetUnitsInPlotLayerIndex Units.GetUnitsInPlotLayerIndex(x: integer/Plot, y?: integer) → Unit[]
✓ exists at runtime (not called)
ui-cache yes ↗ 0x6c43c0 0x6c4a80