Events.SerialEventHexCultureChanged (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Events.

This is a static method, invoke it with a dot.


This event is triggered every time a hex changes ownership anywhere on the map.


Usage

void Events.SerialEventHexCultureChanged(int hexX, int hexY, PlayerID player, bool unknown)


Event Type

Unknown

Parameters

hexX: Hex x-coordinate of the tile whose ownership has changed. This can be converted to map grid (plot) coordinates with the ToGridFromHex function (see example)
hexY: Hex y-coordinate of the tile whose ownership has changed. This can be converted to map grid (plot) coordinates with the ToGridFromHex function (see example)
player: The ID of the new owner (key to the Players table)
unknown: Seems to be always false


Examples

function onHexCultureChanged(iHexX, iHexY, iPlayerID, bUnknown)
print(string.format("New hex claimed at coordinates: %d, %d for player: %d", iHexX, iHexY, iPlayerID))
end
Events.SerialEventHexCultureChanged.Add(onHexCultureChanged)


The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.