MTAutocolors/README.md

55 lines
3.3 KiB
Markdown
Raw Permalink Normal View History

2018-12-13 21:25:14 +01:00
# MTAutocolors
A tool to generate a colors.txt from the registered nodes of a Minetest server.
To have a colors.txt for Minetest mapping for example with [MTSatellite](https://bitbucket.org/s_l_teichmann/mtsatellite)
you need a colors.txt file. You can grab one from [VanessaE](http://digitalaudioconcepts.com/vanessa/hobbies/minetest/colors.txt)
or build one yourself.
gravgun wrote the generator [automappercolors](https://github.com/MinetestForFun/minetest-minetestforfun-server/tree/master/mods/automappercolors).
MTAutocolors is a slightly extended version of this generator being much faster, too (The image processor
is written in Go instead of Python). It consists of two parts:
1. The included [mod](https://bitbucket.org/s_l_teichmann/mtautocolors/src/default/mods/automappercolors/) to be installed into your minetest
server to extract the needed node informations.
2. The program `mtautocolors` to generate the final colors.txt file from the
informations gathered by the mod.
## Build
Your need a [Go](http://golang.org/) 1.8 or later [installation](https://golang.org/dl/) to compile the program.
Go 1.9.2+ is recommended as there is a known issue with decoding images in earlier versions.
Mercurial and Git have to be install installed.
$ go get -u bitbucket.org/s_l_teichmann/mtautocolors/cmd/mtautocolors
will result in a binary `mtautocolors` to be put into your PATH.
## Usage
Install the [mod](https://bitbucket.org/s_l_teichmann/mtautocolors/src/default/mods/automappercolors/) into your
Minetest server. Start your game. Now you can type `/amcdumpnodes` as a chat command in the Minetest client. This
will result in a file `amc_nodes.txt` in the data directory of your world. Once created you can deactivate the
mod until you install or remove mods or update the game in a way which changes the registered nodes.
`mtautocolors` needs a few arguments. The path to the `amc_nodes.txt` file generated with the mod and
paths to the images of your minetest server. This would be the root of the minetest server and/or the folder
where you have the actual minetest game. Something like this (adjusted to your setting):
$ mtautocolors -predefined=/predefined.json \
/home/xyz/minetest/worlds/colors/amc_nodes.txt \
/home/xyz/minetest/ /home/xyz/minetest_game > colors.txt
There is an option to overwrite the machine generated behavior for certain kinds
of nodes with a JSON file. Look at [predefined.json](https://bitbucket.org/s_l_teichmann/mtautocolors/src/default/predefined.json)
to get the idea. Basically its a list of entries with a regular expression matching the node name
and a tuple of RGBA values which should be used instead of the machine generated.
Transparency: Some nodes should be transparent like glass or water. `mtautocolors` only generates
a alpha channel for nodes with of certain draw types. By default this are the ones which drawtype contains 'glasslike' or 'liquid'.
This can be overwritten with the `-transparent=` flag.
This is Free Software under the terms of the MIT license. See [LICENSE](https://bitbucket.org/s_l_teichmann/mtautocolors/src/default/LICENSE)
for details.
gravgun's original is covered by the WTFPL license. See [LICENSE](https://bitbucket.org/s_l_teichmann/mtautocolors/src/default/mods/automappercolors/LICENSE)
for details, too.