Mod API Reference:Client TerritoryInfo

From War.app Wiki
Revision as of 10:53, 2 November 2026 by Fizzer (talk | contribs) (Created page with "Put the function in a file named <code>Client_TerritoryInfo.lua</code>: <pre> function Client_TerritoryInfo(game, territory, info) info.AddRow('Fortified: +3 defense'); end </pre> The client calls this hook when a player looks at a territory: in the territory inspector, and in the tooltip shown when hovering over it. Each row your mod adds is shown on its own line. {| class="wikitable" ! Argument !! Type !! Description |- | <code>game</code> || Mod API Reference...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Put the function in a file named Client_TerritoryInfo.lua:

function Client_TerritoryInfo(game, territory, info)
    info.AddRow('Fortified: +3 defense');
end

The client calls this hook when a player looks at a territory: in the territory inspector, and in the tooltip shown when hovering over it. Each row your mod adds is shown on its own line.

Argument Type Description
game ClientGame Information about the game.
territory TerritoryDetails The territory being looked at. Use territory.ID to look it up elsewhere, such as in game.LatestStanding.Territories.
info table The object you add rows with. See below.
  • info.AddRow(text): adds a line of plain text. It returns info, so calls can be chained.

Limits and notes:

  • Up to 10 rows per mod are shown, and each row is cut to 200 characters. Extra rows are ignored, and a warning is written to the mod log.
  • The client remembers your rows for each territory until the game refreshes or the player views a different point in the game's history. It doesn't call the hook every time the tooltip is drawn.
  • game.LatestStanding is always the latest turn, even when the player is viewing history.
  • If the hook errors, the error is shown once. The hook isn't called again until the game next refreshes or the player views a different point in history, so a broken mod doesn't show an error for every territory the player hovers over.