Table of Contents
Scripts > Import heightmap tile
Script contents// Author: A. Torpy // Updated: 14 Jul 2011 hvar hMap set hMap <GetMap "HF"> assert hMap "Cannot get heightfield!" // exit immediately if HF is not initialised assert <map.GetWidth hMap> "Heightfield is not initialised!" // initialise and edit file selector filesel FS filesel.Init &FS true NULL "Heightfield files|*.hfz;*.hf2;*.hff;*.ter;*.bt;*.png;*.bmp;*.tga|All files (*.*)|*.*|" NULL NULL assert <EditUI &FS "Select tile to import"> "Import aborted" // initialise and edit settings list int ls.x_offset ls.y_offset set ls.x_offset 0 set ls.y_offset 0 assert <EditUI &ls "Tile overlay settings"> "Import aborted" // load the map tile map TileMap assert <map.LoadFile2 &TileMap <filesel.GetPathA &FS> HF false true> "Error loading file" // store a backup L3DTio_Backup.BackupMap "HF" "Import HF tile" 0 "view.ShowMap \"HF\"" // overlay the tile assert <calc.HF.CombineMapsEx hMap &TileMap 4 ls.x_offset ls.y_offset 0 0> "Error combining maps" // refresh the heightfield view.ShowMap "HF" CommentsNone. Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
|