MapChunks

Helper enum and functions for a more “human” accessible way of using map chunks.


TRSMapChunk

Helper record to store chunk data with a name associated with.


Chunk

function Chunk(b: TBox; planes: TIntegerArray): TRSMapChunk;
function Chunk(b: TBox; plane: Integer): TRSMapChunk; overload;

Helper functions to create TRSMapChunks.


TRSMapChunkArray.CreateFromString

function TRSMapChunkArray.CreateFromString(str: String): TRSMapChunkArray; static;

Creates a TRSMapChunkArray from a string. This is quite tolerant but extects the string to have a certain format.

Some example of valid strings this will be able to handle are:

Map.Setup([Chunk(Box(45,51,46,50), 0)]);
Map.Setup([[[45,51,46,50], 0]]);
Map.Setup([[[45,51,46,50], [0,2]]]);
Map.Setup([[[45,51,46,50], [0,2]], Chunk([45,51,46,50], [0]);
Map.SetupChunk(Chunk([45,51,46,50], 0));
[[[45,51,46,50], [0,2]]
[[[45,51,46,50], 2]
45,51,46,50 - 0

To put it simply, it will try it’s best to parse the string and look for the box coordinates first and then plane numbers.

It can also handle multiple chunks in a string.

Note

While it’s very flexible, it does not validate anything. If what you pass in is not a valid chunk your script will probably crash.

E.G. plane 55 which doesn’t exist.


EBankChunk

EBankChunk is a enumerator that contains all bank chunks supported by WaspLib.