====== Scripts > ExportHeightfieldAsTiles ====== ^ Description | Exports the heightfield as a set of HF2 tile files. This script has better memory management for very large tile sizes (>4096) than the usual mosaic export option. | ^ Author | [[user>Aaron]] | ^ Created | 2010/02/03 | ^ Requires | L3DT v2.8 build 7 or later. | ^ Download | {{:scripts:exportheightfieldastiles.zs|ExportHeightfieldAsTiles.zs}} | ===== Script contents ===== hvar hMap set hMap int nx ny set nx set ny assert nx "Map not initialised!" string FileName set FileName if > return false endif string BaseFileName set BaseFileName string FileExt set FileExt hvar hFormat set hFormat assert hFormat "Cannot find format!" int TileSize set TileSize 512 if > return false endif assert "Invalid tile size!" int nTilesX set nTilesX
if incr nTilesX endif int nTilesY set nTilesY
if incr nTilesY endif int ti tj set tj 0 do set ti 0 do int x1 x2 y1 y2 set x1 set y1 set x2 > set y2 > if > set x2 endif if > set y2 endif string TileName set TileName > set TileName > set TileName > assert "Export failed!" while nTilesX> while nTilesY> return true ===== Comments ===== None.