From Stealth Client

Jump to: navigation, search

Tile

ConvertIntegerToFlags

Translate the numeric value of flags in the flags and takes two arguments:

  • Group that can be either:
    • 1 for land;
    • 2 for statics;
  • Value is the numeric value of flags.
function ConvertIntegerToFlags(Group : byte; Value : LongWord) : TTileDataFlagSet
 
TTileDataFlagSet:
TTileDataFlags = (
tsfBackground,
tsfWeapon,
tsfTransparent,
tsfTranslucent,
tsfWall,
tsfDamaging,
tsfImpassable,
tsfWet,
tsfUnknown,
tsfSurface,
tsfBridge,
tsfGeneric,
tsfWindow,
tsfNoShoot,
tsfPrefixA,
tsfPrefixAn,
tsfInternal,
tsfFoliage,
tsfPartialHue,
tsfUnknown1,
tsfMap,
tsfContainer,
tsfWearable,
tsfLightSource,
tsfAnimated,
tsfNoDiagonal,
tsfUnknown2,
tsfArmor,
tsfRoof,
tsfDoor,
tsfStairBack,
tsfStairRight,
tlfTranslucent,
tlfWall,
tlfDamaging,
tlfImpassable,
tlfWet,
tlfSurface,
tlfBridge,
tlfPrefixA,
tlfPrefixAn,
tlfInternal,
tlfMap,
tlfUnknown3);
TTileDataFlagSet = set of TTileDataFlags;

Here is a sample

Program New;
var   FlagSet: TTileDataFlagSet;
begin
// флаги, что соответствуют 67117569
// [tdfBackground,tdfSurface,tdfNoShoot,tdfUnknown2]
FlagSet:= ConvertIntegerToFlags(2, 67117569);
IF tdfSurface in FlagSet then
AddToSystemJournal('surface'); 
IF tdfImpassable in FlagSet then
AddToSystemJournal('impass'); 
end.

GetLandTileData

function GetLandTileData(Tile : Word) :TLandTileData
 
TLandTileData = record
Flags : Cardinal;
TextureID : Word;
Name : array[0..19] of Char;
end;

Returns the details of a Tile.

GetLandTilesArray

function GetLandTilesArray(Xmin, Ymin, Xmax, Ymax : Word; WorldNum : byte; TileType : Word; var LandTilesArray : TFoundTilesArray) : Word

Search for a given tile of map

TFoundTilesArray = array[0..999] of TFoundTile;
 
TFoundTile = record 
  X : SmallInt; 
  Y : SmallInt; 
  Z : ShortInt; 
  Tile : Word; 
end;

GetLayerCount

function GetLayerCount(x, y:word; WorldNum : byte):byte

Number of layers in static point

GetMapCell

function GetMapCell(X,Y : Word; WorldNum : Byte) : TMapCell
 
TMapCell = record
Tile : Word;
Z : ShortInt;
end;

Return information on the ground tile.

GetNextStepZ

function GetNextStepZ(CurrX,CurrY, DestX, DestY : Word; WorldNum : byte; Z : ShortInt) : ShortInt

GetStaticTileData

function GetStaticTileData(Tile : Word) :TStaticTileData
 
TStaticTileData = record
Flags : Int64;
Height : Integer;
RadarColorRGBA : array[0..3] of Byte;
Name : Array[0..19] of Char;

Details of tile statics

GetStaticTilesArray

function GetStaticTilesArray(Xmin, Ymin, Xmax, Ymax : Word; WorldNum : byte; TileType : Word;var FoundTilesArray : TFoundTilesArray) : Word
def GetStaticTilesArray( Xmin : Integer, Ymin : Integer, Xmax : Integer, Ymax : Integer, WorldNum : Integer, TileType : Integer) -> List of Tuples

Search by ticker Tile statics

GetSurfaceZ

function GetSurfaceZ(X,Y : Word;WorldNum : Byte) : ShortInt

Learn Z coordinate in the world.

GetTileFlags

function GetTileFlags(Group : byte; Tile : Word) : Cardinal

Get flags for a given Tile. Takes two arguments:

  • Group that can be either:
    • 1 for land;
    • 2 for statics;
  • Tile is the ID of the tile to inspect.

IsWorldCellPassable

function IsWorldCellPassable (CurrX, CurrY : Word; Z : ShortInt; DestX, DestY : Word; var DestZ : ShortInt; WorldNum : Byte) : Boolean

Проверка проходимости точки

ReadStaticsXY

function ReadStaticsXY(X,Y:word; WorldNum : byte):TStaticCell
 
TStaticCell = packed record
Statics : Array of TStaticItem;
StaticCount : Byte;
end;
 
TStaticItem = record
Tile : Word;
X : Byte;
Y : Byte;
Z : ShortInt;
Color : Word;
end;

Return an array of statics in the world.