Here's a little command-line tool i made in pascal, that takes a .vxl file and converts its binary byte values into a text file with a customizable delimiter. Pretty fast, converts your average map in less than a second. Currently doesn't do anything if the process fails. Probably could be used as a part of a toolchain to interpret map data for whatever reasons... another custom server implementation, anyone?
Command line options (each next option requires the previous to be present, that's what the 0 is for):
1. input - none, 0 or string - the input file, filename+extension, can be absolute path, if none/0 then 'input.vxl'
2. output - none, 0 or string - the output file, filename+extension, can be absolute path, if none/0 then 'output.txt'
3. delimiter - none, 0 or char (string works, not recommended) - the value delimiter, if none/0 then ',' (comma, used in .csv)
4. wait - none, 'wait' (no quotes) - if present, makes program wait for user to press any key to quit
Example usage:
- vxl2txt.exe mycoolmap.vxl nowistext.txt . wait
this will take the file mycoolmap.vxl and process it into nowistext.txt with delimiter '.' and will wait for user input before closing - vxl2txt.exe c:\aos\maps\mapfile.vxl 0 -
this will take the file at c:\... and process it into output.txt (in the same directory as .exe) with delimiter '-', and will close after done - vxl2txt.exe 0 0 0 wait
this will use the default parameters (input.vlx, output.txt, comma delimited), but will wait for user input before closing
Source code (v2) (Pascal, commented, 71 line): http://pastebin.com/vw8HxiXE
TXT2VXL CPP (v1, stable)
After being unhappy with the speed TXT2VXL ran at, i decided to rewrite it in C. That plan failed miserably because i am incapable of wrapping my head around memory management in that language (even with the help of LeCom), so i switched over to C++. That went a bit better, so i bring you TXT2VXL CPP. I still found that programming in Pascal is easier for me, and the algorithm i used this time might not be the most efficient, but the results speak for themselves - TXT2VXL processed my map in around 8 seconds, whereas TXT2VXL CPP needed only 2, the C++ version being 4 times faster. Also, the command line parameters are implemented in the exact same way as for the tool below, although the way results are displayed is slightly different. The files generated are exactly the same, as checked with a Notepad++ plugin.
Download (v1) (500 KB): https://www.dropbox.com/s/ik5x4yaw4jk4z ... p.exe?dl=0
Source code (v1) (C++, commented, 103 lines): http://pastebin.com/9Ab48gt2
TXT2VXL (v5.1, stable)
I figured that the previous tool would be pretty much useless without a way to get back to .vxl file, so after some initial difficulties, i made one. This does the exact opposite of the tool above - it takes a .txt file with byte values in ascii format, separated by a delimiter, and converts them into bytes stored in binary. The good part is that the delimiter is detected automatically, although only a single character is supported because of this. It is certainly a lot slower than the first tool, but still converts a map in less than 10 seconds.
Command line options (each next option requires the previous to be present, that's what the 0 is for):
1. input - none, 0 or string - the input file, filename+extension, can be absolute path, if none/0 then 'output.txt'
2. output - none, 0 or string - the output file, filename+extension, can be absolute path, if none/0 then 'output.vxl'
3. wait - none, 'wait' (no quotes) - if present, makes program wait for user to press any key to quit
Example usage:
- same as above, just without the delimiter parameter
Source code (v5.1) (Pascal, commented, 108 lines): http://pastebin.com/nZpMypr5
Test if it works.
If you aren't very confident of my programming skills (i sure as hell am not), then feel free to grab a map file and put it in the directory of the executable files, then convert it back and forth. I've even made this easy for you - just rename your map file "input.vxl", then run vxl2txt and once it's done, txt2vxl. You will get 2 files - output.txt, which is the delimited text format, and output.vxl, which should be perfectly identical to your .vxl map file.
Here's a screenshot (click for full size):
Bugs.
- The file size readings given out by the application seem a bit off.
- Make something to convert .vxl into an array of voxels.
- Convert these utilities to .dll format.