Jump to content

MapConverter: Difference between revisions

From fCraft Wiki
mNo edit summary
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
MapConverter is a utility, bundled with fCraft 0.630+, that can convert mapfiles between different file formats.
{{notice|Latest experimental build (with 0.900+ features) can be downloaded here: '''[https://www.fcraft.net/download/MapConverter_0900_r2357.zip MapConverter_0900_r2357.zip] [0.5 MB]'''
 
This is a portable build, and can be used without fCraft.dll. Requires .NET 4.0}}
[[Image:MapConverter-usage-0.630.png|thumb|500px|right|MapConverter usage]]
MapConverter is a utility, bundled with fCraft {{Changelog|0.630}}+, that can convert mapfiles between different file formats. MapConverter requires <code>fCraft.dll</code> to function.
==Usage==
==Usage==
:<code>MapConverter [options] -e=ExporterName "FileOrDirectory"</code>
:'''<code>MapConverter [options] -e=ExporterName "MapFile1" "MapFile2" "MapFile3..."</code>'''
:'''<code>MapConverter [options] -e=ExporterName "Directory"</code>'''


==Examples==
==Examples==
===Single file conversion===
===Single file conversion===
:<code>MapConverter -e=MCSharp "filename.dat"</code>
:'''<code>MapConverter -e=MCSharp "filename.dat"</code>'''
:Converts a single file named "filename.dat" to MCSharp format, and saves it to "filename.lvl"
:Converts a single file named "filename.dat" to MCSharp format, and saves it to "filename.lvl"


===Batch conversion===
===Batch conversion===
:<code>MapConverter -r -e=FCMv3 "C:/maps"</code>
:'''<code>MapConverter -r -e=FCMv3 "C:/maps"</code>'''
:Finds all map files in "C:/maps", including files in subdirectories, and converts them to FCMv3 (.fcm) format. Each converted file is saved into the same directory as the original file.
:Finds all map files in "C:/maps", including files in sub-directories, and converts them to FCMv3 (.fcm) format. Each converted file is saved into the same directory as the original file.


===Moving out conveted maps===
===Moving out converted maps===
:<code>MapConverter -r -o "C:/converted" -e=FCMv3 "C:/maps"</code>
:'''<code>MapConverter -r -o="C:/converted" -e=FCMv3 "C:/maps"</code>'''
:Same as above, but converted map files are all placed into "C:/converted" directory.
:Same as above, but converted map files are all placed into "C:/converted" directory.


===Filtering===
===Filtering===
:<code>MapConverter -f=builder* -e=Opticraft "old_maps"</code>
:'''<code>MapConverter -f=builder* -e=Opticraft "old_maps"</code>'''
:Looks for filenames that start with "builder", in a directory named "old_files".
:Looks for file names that start with "builder", in a directory named "old_files".


==Options==
==Options==
===<code>e= / exporter=</code>===
{{notice|Options have alternative short (one-letter) and a long (whole word) forms. You can use either form: '''<code>-e{{=}}MCSharp</code>''' is same as '''<code>--exporter{{=}}MCSharp</code>'''
:REQUIRED: Converter used for exporting/saving maps. Available exporters:
One-letter flags can be combined: '''<code>-rty</code>''' is same as '''<code>-r -t -y</code>}}
:*'''D3''' (.map)
===<code>-e=, --exporter=FORMAT</code>===
:*'''FCMv3''' (.fcm) - used in fCraft 0.500-0.630
:REQUIRED: Converter used for exporting/saving maps. Available formats:
:*'''FCMv4''' (.fcm) - planned format for future versions of fCraft
:*'''ClassicWorld''' (.cw) - used by ClassiCube and fCraft 0.900+ (<i>new in 0.900</i>)
:*'''D3''' (.map) - used by old versions D3 server
:*'''D3Folder''' (folder) - used by newer versions of D3 server (<i>new in 0.900</i>)
:*'''FCMv3''' (.fcm) - used in fCraft 0.500-0.64x
:*'''JTE''' (.gz)
:*'''JTE''' (.gz)
:*'''MCSharp''' (.lvl) - MCSharp, FemtoCraft, MCZall, MCLawl, MCForge, etc
:*'''MCSharp''' (.lvl) - MCSharp, FemtoCraft, MCZall, MCLawl, MCForge, etc
Line 32: Line 38:
:*'''Opticraft''' (.save)
:*'''Opticraft''' (.save)
:*'''Raw''' (.raw) - block data array, without any metadata
:*'''Raw''' (.raw) - block data array, without any metadata
:*'''Schematic''' (.schematic) - classic tileset (<i>new in 0.900</i>)
:*'''ModernSchematic''' (.schematic) - converted-to-modern tileset (for improved compatibility) (<i>new in 0.900</i>)
===<code>-f=, --filter=PATTERN</code>===
:Optional: Pattern to filter input filenames, e.g. <code>*.dat</code> or <code>builder*</code>. Applicable only when a directory name is given as input. [http://msdn.microsoft.com/en-us/library/hs600312%28v=vs.100%29.aspx Regular expressions] can be used in the filter if <code>-x</code> / <code>--regex</code> flag is given.


===<code>i= / importer=</code>===
===<code>-i=, --importer=FORMAT</code>===
:Optional: Converter used for importing/loading maps. Available importers:
:Optional: Converter used for importing/loading maps. Available importers:
:*'''Auto''' - default; tries to determine file type automatically
:*'''Auto''' - default; tries to determine file type automatically
:*'''Classic''' (.dat or .mine) - Minecraft Classic and SurvivalTest maps
:*'''Classic''' (.dat or .mine) - Minecraft Classic and SurvivalTest maps
:*'''ClassicWorld''' (.cw) - used by ClassiCube and fCraft 0.900+ (<i>new in 0.900</i>)
:*'''D3''' (.map)
:*'''D3''' (.map)
:*'''D3Folder''' (folder) - used by newer versions of D3 server (<i>new in 0.900</i>)
:*'''FCMv2''' (.fcm) - used by fCraft prior to version 0.500
:*'''FCMv2''' (.fcm) - used by fCraft prior to version 0.500
:*'''FCMv3''' (.fcm) - used in fCraft 0.500-0.630
:*'''FCMv3''' (.fcm) - used in fCraft 0.500-0.64x
:*'''FCMv4''' (.fcm) - planned format for future versions of fCraft
:*'''Indev''' (.mclevel) - from Minecraft Indev maps
:*'''Indev''' (.mclevel) - from Minecraft Indev maps
:*'''JTE''' (.gz)
:*'''JTE''' (.gz)
Line 48: Line 60:
:*'''Opticraft''' (.save)
:*'''Opticraft''' (.save)


===<code>o= / output=</code>===
===<code>-o=, --output=PATH</code>===
:Optional: Path to save converted map files to. If not specified, converted maps will be saved to the original maps' directory.
:Optional: Path to save converted map files to. If not specified, converted maps will be saved to the original maps' directory.


===<code>f= / filter=</code>===
===<code>-r, --recursive</code>===
:Optional: Pattern to filter input filenames, e.g. <code>*.dat</code> or <code>builder*</code>. Applicable only when a directory name is given as input.
:Optional: Look through all subdirectories, and convert map files there too. Applicable only when a directory name is given as input.
 
===<code>-t, --tryhard</code>===
:Optional: Try ALL the map converters on files that MapRenderer has trouble loading. When enabled, ALL map converters are tried, including ones that do not typically handle files with the given file extension.


===<code>r / recursive</code>===
===<code>-x, --regex</code>===
:Optional: Look through all subdirectories, and convert map files there too. Applicable only when a directory name is given as input.
:Optional: Enable [http://msdn.microsoft.com/en-us/library/hs600312%28v=vs.100%29.aspx regular expressions] in "filter".


===<code>y / overwrite</code>===
===<code>-y, --overwrite</code>===
:Optional: Do not ask for confirmation to overwrite existing files.
:Optional: Do not ask for confirmation to overwrite existing files.


===<code>? / help / h</code>===
===<code>-?, -h, --help</code>===
:Prints usage information and a list of options.
:Prints usage information and a list of options.
==MapConverter.exe edit codes==
{|class="wikitable"
!Code
!Meaning
!Notes
|-
|0
|Success
|
|-
|1
|ArgumentError
|Required command-line arguments were missing, or an error occurred while trying to parse options.
|-
|2
|UnrecognizedImporter
|Given importer name was not recognized.
|-
|3
|UnrecognizedExporter
|Given exporter name was not recognized.
|-
|4
|InputPathNotFound
|Given file/directory name does not exist.
|-
|5
|PathError
|Error occurred while trying to check input directory, or error occurred while trying to check/create output directory.
|-
|6
|UnsupportedLoadFormat
|Given "importer" format name was recognized, but loading from it is not supported.
|-
|7
|UnsupportedSaveFormat
|Given "exporter" format name was recognized, but saving to it is not supported.
|}
{{LastUpdated|1650}}
[[Category:Tools]]

Latest revision as of 01:15, 18 June 2015

Latest experimental build (with 0.900+ features) can be downloaded here: MapConverter_0900_r2357.zip [0.5 MB]

This is a portable build, and can be used without fCraft.dll. Requires .NET 4.0

MapConverter usage

MapConverter is a utility, bundled with fCraft 0.630+, that can convert mapfiles between different file formats. MapConverter requires fCraft.dll to function.

Usage

MapConverter [options] -e=ExporterName "MapFile1" "MapFile2" "MapFile3..."
MapConverter [options] -e=ExporterName "Directory"

Examples

Single file conversion

MapConverter -e=MCSharp "filename.dat"
Converts a single file named "filename.dat" to MCSharp format, and saves it to "filename.lvl"

Batch conversion

MapConverter -r -e=FCMv3 "C:/maps"
Finds all map files in "C:/maps", including files in sub-directories, and converts them to FCMv3 (.fcm) format. Each converted file is saved into the same directory as the original file.

Moving out converted maps

MapConverter -r -o="C:/converted" -e=FCMv3 "C:/maps"
Same as above, but converted map files are all placed into "C:/converted" directory.

Filtering

MapConverter -f=builder* -e=Opticraft "old_maps"
Looks for file names that start with "builder", in a directory named "old_files".

Options

Options have alternative short (one-letter) and a long (whole word) forms. You can use either form: -e=MCSharp is same as --exporter=MCSharp

One-letter flags can be combined: -rty is same as -r -t -y

-e=, --exporter=FORMAT

REQUIRED: Converter used for exporting/saving maps. Available formats:
  • ClassicWorld (.cw) - used by ClassiCube and fCraft 0.900+ (new in 0.900)
  • D3 (.map) - used by old versions D3 server
  • D3Folder (folder) - used by newer versions of D3 server (new in 0.900)
  • FCMv3 (.fcm) - used in fCraft 0.500-0.64x
  • JTE (.gz)
  • MCSharp (.lvl) - MCSharp, FemtoCraft, MCZall, MCLawl, MCForge, etc
  • MinerCPP (.dat) - also works for LuaCraft
  • Opticraft (.save)
  • Raw (.raw) - block data array, without any metadata
  • Schematic (.schematic) - classic tileset (new in 0.900)
  • ModernSchematic (.schematic) - converted-to-modern tileset (for improved compatibility) (new in 0.900)

-f=, --filter=PATTERN

Optional: Pattern to filter input filenames, e.g. *.dat or builder*. Applicable only when a directory name is given as input. Regular expressions can be used in the filter if -x / --regex flag is given.

-i=, --importer=FORMAT

Optional: Converter used for importing/loading maps. Available importers:
  • Auto - default; tries to determine file type automatically
  • Classic (.dat or .mine) - Minecraft Classic and SurvivalTest maps
  • ClassicWorld (.cw) - used by ClassiCube and fCraft 0.900+ (new in 0.900)
  • D3 (.map)
  • D3Folder (folder) - used by newer versions of D3 server (new in 0.900)
  • FCMv2 (.fcm) - used by fCraft prior to version 0.500
  • FCMv3 (.fcm) - used in fCraft 0.500-0.64x
  • Indev (.mclevel) - from Minecraft Indev maps
  • JTE (.gz)
  • MCSharp (.lvl) - MCSharp, FemtoCraft, MCZall, MCLawl, MCForge, etc
  • MinerCPP (.dat) - MinerCPP and LuaCraft
  • Myne (directory-based) - Myne, MyneCraft, Hyvebuild, and iCraft
  • Opticraft (.save)

-o=, --output=PATH

Optional: Path to save converted map files to. If not specified, converted maps will be saved to the original maps' directory.

-r, --recursive

Optional: Look through all subdirectories, and convert map files there too. Applicable only when a directory name is given as input.

-t, --tryhard

Optional: Try ALL the map converters on files that MapRenderer has trouble loading. When enabled, ALL map converters are tried, including ones that do not typically handle files with the given file extension.

-x, --regex

Optional: Enable regular expressions in "filter".

-y, --overwrite

Optional: Do not ask for confirmation to overwrite existing files.

-?, -h, --help

Prints usage information and a list of options.

MapConverter.exe edit codes

Code Meaning Notes
0 Success
1 ArgumentError Required command-line arguments were missing, or an error occurred while trying to parse options.
2 UnrecognizedImporter Given importer name was not recognized.
3 UnrecognizedExporter Given exporter name was not recognized.
4 InputPathNotFound Given file/directory name does not exist.
5 PathError Error occurred while trying to check input directory, or error occurred while trying to check/create output directory.
6 UnsupportedLoadFormat Given "importer" format name was recognized, but loading from it is not supported.
7 UnsupportedSaveFormat Given "exporter" format name was recognized, but saving to it is not supported.