Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

GetMapCell

Returns information about the map (land) cell at the specified coordinates, including the tile graphic and Z level.

In Python, this method is named GetCell.

Возвращает информацию о ячейке карты (ландшафта) по указанным координатам, включая графику тайла и уровень Z.

В Python метод называется GetCell.

Pascal

function GetMapCell(X: Word; Y: Word; WorldNum: Byte): TMapCell;

Type definition:

TMapCell = packed record
  Tile: Word;
  Z: ShortInt;
end;

Parameters:

  • X, Y — map coordinates.
  • WorldNum — world/facet number.

Python

def GetCell(X: int, Y: int, WorldNum: int) -> MapCell: ...

Pascal Example

var
  Cell: TMapCell;
begin
  Cell := GetMapCell(GetX(Self), GetY(Self), WorldNum);
  AddToSystemJournal('Land tile: $' + IntToHex(Cell.Tile, 4) + ' Z: ' + IntToStr(Cell.Z));
end.

Python Example

cell = GetCell(GetX(Self()), GetY(Self()), WorldNum())
AddToSystemJournal(f'Land tile: ${cell.Tile:04X} Z: {cell.Z}')

See Also

GetSurfaceZ, GetLayerCount