diff --git a/docs/batch.md b/docs/batch.md index 7b9eaa3..70297a9 100644 --- a/docs/batch.md +++ b/docs/batch.md @@ -8,7 +8,7 @@ See also the [GUI usage](https://gitlab.com/bztsrc/mtsedit/blob/master/docs/usag ``` MineTest Schematics Editor by bzt Copyright (C) 2019 MIT license -./mtsedit [-v] [-l lang] [-d|-p|-P] [-m map] <.mts|.schematic> [out.mts] +./mtsedit [-h] [-v] [-l lang] [-d|-p|-P] [-m map] <.mts|.schematic> [out.mts] ./mtsedit -g ./mtsedit -t [blockid] ./mtsedit -i [Minetest mods dir] diff --git a/docs/blocks.md b/docs/blocks.md index 48c28cb..b012880 100644 --- a/docs/blocks.md +++ b/docs/blocks.md @@ -18,7 +18,7 @@ Block definitions are looked for in several directories, even depending on opera Blocks.csv ---------- -In the `data` directory, mtsedit looks for this CSV file. It is used to define blocks used in different file formats. +In the `data` directory, mtsedit looks for this CSV file. It defines block types used in different file formats. Each line contains comma separated values, which might be surrounded by quotes. Commas inside quoted strings does not count as coloumn separators. The lines are ended in '\\n' newline character, carrige return '\\r' is optional. This database can be generated on the fly with [MTSEdit Minetest Mod](https://gitlab.com/bztsrc/mtsedit/tree/master/mt-mod) @@ -27,7 +27,8 @@ from within the game (with all your desired mods enabled). ### Header The first row is special, it defines the coloumn names. The first 4 coloumns are irrelevant and not parsed, others -define the name of the block mapping (each coloumn is one mapping). +define the name of the block mappings (each coloumn is one mapping). These are the names used by the "/mtsedit export" +chat command, and they are also shown on the Save As window. ### Coloumns @@ -39,7 +40,8 @@ define the name of the block mapping (each coloumn is one mapping). | 4th | string | an optional mapgen alias name for the block (like "mapgen_stone") | | 5th+ | string | block's name in the mapping (this coloumn may be repated as many times as you like) | -Block mapping are sometimes referenced as node palette. +Block mappings are sometimes referenced as node palette. The repository ships a default blocks.csv with two coloumns, +mappings for "Mineclone2" and "Minetest Game", but feel free to add as many more mappings as you wish. Block Images ------------ diff --git a/mt-mod/README.md b/mt-mod/README.md index 3d76896..b7fb8d6 100644 --- a/mt-mod/README.md +++ b/mt-mod/README.md @@ -19,18 +19,19 @@ If you don't have the source, only the installed executable, you can run ### Dependencies -None. This mod works on its own, has absolutely zero dependency. +None, not even "default". This mod works on its own, has absolutely zero dependency. __IMPORTANT__: the Lua API can't access files outside of the world directory, so you have to copy your existing blocks.csv -there (on Linux "~/.minetest/worlds/(world name)"), run the chat command, then copy the result back to /usr/share/mtsedit. +there (on Linux "~/.minetest/worlds/(world name)"), run the chat command, then copy the result back to /usr/share/mtsedit. -Likewise, you have to place your schematic files under "(world directory)/schems/", other directories are not reachable from Lua. +Likewise, you have to place your schematic files under "~/.minetest/worlds/(world name)/schems/", other directories are not +reachable from Lua. Usage ----- -Enable the mod. It does not depend on any game mods, so that you can use it with all games. Start your world, then go to -the chat (probably F10 if you haven't changed the shortcut). +Enable the mtsedit mod. It does not depend on any game mods, so that you can use it with all games and all mods. Start your world, +then go to the chat (probably F10 if you haven't changed the shortcut). Type ``` @@ -43,28 +44,6 @@ or to get help. When you first run this command, it will give you a "MTSEdit Magic Placement Wand Tool" (TM) :-) -### Exporting node data for MTSEdit - -In the chat window issue the following command - -``` -/mtsedit export Minetest Game -``` -Where the argument is one of the coloumns in block.csv, so called node palette. If the blocks.csv exists in the world directory, -then this mod will read it, and it will only update that particular one coloumn. If the file does not exists, then it will be -created. If it exists, but there's no such coloumn as specified in the argument, then a new node palette will be created. - -The Lua script tries to figure out which node is which, but because you can enable lots of mods in Minetest (each allowed to -register it's own node types), that's not an easy task. It does a pretty decent job though, usually about 80% of the records -are correct, and only 20% percent requires manual fixing. For Mineclone2, I've provided an almost entirely complete blocks.csv, -which also contains the Minecraft NBT .schematic files' Block IDs. - -To export node texture data, use -``` -/mtsedit imgs -``` -This will save blockimgs.csv in the world directory. - ### Importing MTS files For that, enter chat and run @@ -77,12 +56,13 @@ That's all. Depending on which direction you're looking at your punched node, th repeat this right click as many times as you want. The same structure will be placed until you issue another "/mtsedit load" command. -To help you with the files, +To help you with the names, ``` /mtsedit list ``` -will list the available MTS files in your world directory's "schems" sub-dir. +will list the available MTS files in your world directory's "~/.minetest/worlds/(my world)/schems/" sub-dir. These are the ones +that you can use with the "load" command. ### Exporting MTS files @@ -102,4 +82,29 @@ When you're satisfied with the selection, go to the chat window, and ``` will save that area into an MTS file into the "schems" directory. After that you can open it with MTSEdit outside of the game. +### Exporting node data for MTSEdit + +In the chat window issue the following command + +``` +/mtsedit export Minetest Game +``` +Where the argument is one of the coloumns in block.csv, so called node palette (or block mapping). This name is totally up to you, +and you'll be able to select it when you save MTS files in the editor. I suggest to use a name that reminds you of the game + mods +combination, like "MTG with moretrees". If the blocks.csv exists in the world directory, then this mod will read it, and it will +only update that particular one coloumn in it. If the csv file does not exists, then it will be created. If the csv exists, but +there's no such mapping as specified in the argument, then a new coloumn will be created by that name. + +The Lua script tries to figure out which node is which, but because you can enable lots of mods in Minetest (each allowed to +register it's own node types), that's not an easy task. It does a pretty decent job though, usually about 80% of the records +are correct, and only 20% percent requires manual fixing. For Mineclone2, I've provided an almost entirely complete blocks.csv, +which also contains the Minecraft NBT .schematic files' Block IDs. + +To export node texture data, use +``` +/mtsedit imgs +``` +This will save blockimgs.csv in the world directory, that you can import with `-t` to generate the block images for the editor. +This is useful if you have enabled mods that register new nodes which have no editor images yet. + Enjoy!