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

GetLandTilesArrayEx

Search of Land tile from array TileTypes in bound, limited by Xmin, Ymin, Xmax, Ymax of world WorldNum, founded tiles added to FoundTilesArray. Returns found amount.

NB: DWS have overloaded method version, which returns TFoundTilesArray. Length can be taken by Length(array_var) calling.

Pascal Script:

function GetLandTilesArrayEx(Xmin : Word; Ymin : Word; Xmax : Word; Ymax : Word; WorldNum : Byte; TileTypes : array of Word; var LandTilesArray : TFoundTilesArray) : Word;

DWS:

function GetLandTilesArrayEx(Xmin : Word; Ymin : Word; Xmax : Word; Ymax : Word; WorldNum : Byte; TileTypes : array of Word; var LandTilesArray : TFoundTilesArray) : Word;
function GetLandTilesArrayEx(Xmin : Word; Ymin : Word; Xmax : Word; Ymax : Word; WorldNum : Byte; TileTypes : array of Word) : TFoundTilesArray;
TFoundTile = record
  Tile : Word;
  X : SmallInt;
  Y : SmallInt;
  Z : ShortInt;
end;

TFoundTilesArray = Array[0..999] of TFoundTile;

Pascal Example:

Python Syntax:

def GetLandTilesArray(Xmin, Ymin, Xmax, Ymax, WorldNum, TileTypes):  --> list

Python Example:

ResourceTiles = set(); Stack = []

def FindResources():
  TilesCache = []
  global ResourceTiles
  for i in [3274, 3275, 3276, 3277, 3280, 3283, 3286, 3289, 3291, 3292, 3294, 3295, 3296, 3299, 3302, 3394, 3395, 3417, 3440, 3461, 4792, 4793, 4794, 4795]:
    for t, x, y, z in GetStaticTilesArray(GetX(Self()) - 50, GetY(Self()) - 50, GetX(Self()) + 50, GetY(Self()) + 50, WorldNum(), i):
      TilesCache.append((t, x, y, z, 'Logs'))
  for i in range(1339, 1359):
    for t, x, y, z in GetStaticTilesArray(GetX(Self()) - 50, GetY(Self()) - 50, GetX(Self()) + 50, GetY(Self()) + 50, WorldNum(), i):
      TilesCache.append((t, x, y, z, 'Ingots'))
  for i in [240, 241, 242, 243]:
    for t, x, y, z in GetLandTilesArray(GetX(Self()) - 50, GetY(Self()) - 50, GetX(Self()) + 50, GetY(Self()) + 50, WorldNum(), i):
      TilesCache.append((t, x, y, z, 'Ingots'))
  ResourceTiles |= set(TilesCache)