Home › Lua API › PlayerVisibility

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

PlayerVisibility

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

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
AddOutgoingVisibility PlayerVisibility:AddOutgoingVisibility(eToPlayer: integer/Player[PlayerTypes]) → boolean
args: eToPlayer — Id of a player (as in Players[id]).
gameplay — 0x6f8a90 0x6f91d0
ChangeVisibilityCount ★ PlayerVisibility:ChangeVisibilityCount(x: integer/Plot, y?: integer, arg3?: integer) (or nothing)
args: y — A number.
gameplay — 0x6f8b70 0x6f92b0
GetLayerValue PlayerVisibility:GetLayerValue(arg1?: number, x: integer/Plot, y?: integer) → number (or nothing)
args: arg1 — A constant from the Lua table VisibilityLayerTypes.
ui-cache — 0x6b7480 0x6b7a00
GetNumRevealedHexes PlayerVisibility:GetNumRevealedHexes() → number gameplay — 0x6f8c80 0x6f93c0
GetState PlayerVisibility:GetState(x: integer/Plot, y?: integer) → number
args: y — A plot coordinate (named x / y / plotX / plotY in the scripts). (inferred)
ui-cache, gameplay — 0x6b7570 0x6b7af0
GetVisibilityCount PlayerVisibility:GetVisibilityCount(x: integer/Plot, y?: integer) → number (or nothing)
args: x — Plot index (plot:GetIndex()). (inferred)
gameplay — 0x6f8e80 0x6f95c0
IsRevealed UI state: PlayerVisibility:IsRevealed(x: integer/Plot, y?: integer) → boolean (or nothing)
gameplay state: PlayerVisibility:IsRevealed(x: integer/Plot, y?: integer) → boolean (or nothing)
ui-cache, gameplay — 0x6b7670 0x6b7bf0
IsUnitVisible PlayerVisibility:IsUnitVisible(arg1: Unit) → boolean (or nothing)
args: arg1 — A Unit object (the scripts pass a variable named pUnit).
ui-cache — 0x6b7750 0x6b7cd0
IsVisible UI state: PlayerVisibility:IsVisible(x: integer/Plot, y?: integer) → boolean (or nothing)
gameplay state: PlayerVisibility:IsVisible(x: integer/Plot, y?: integer) → boolean (or nothing)
args: y — A plot coordinate (named x / y / plotX / plotY in the scripts). (inferred)
ui-cache, gameplay — 0x6b77e0 0x6b7d60
RemoveOutgoingVisibility PlayerVisibility:RemoveOutgoingVisibility(eToPlayer: integer/Player[PlayerTypes]) → boolean
args: eToPlayer — Id of a player (as in Players[id]).
gameplay — 0x6f9140 0x6f9880
RevealAllPlots PlayerVisibility:RevealAllPlots() (or nothing) gameplay — 0x6f9220 0x6f9960

Notes (★)

ChangeVisibilityCount

Raises or lowers the visibility count of a plot for a player, which reveals or hides it.

See also: PlayerVisibility.IsRevealed, AiMilitary.StartScriptedOperationWithTargetAndRally