minetest-mapper-cpp/dumpnodes
Rogier 005e69b8c6 Explicitly set the color of xpanes:bar_* only when computing it failed 2015-11-26 12:00:12 +01:00
..
README.dumpnodes Improve scripts & documentation for generating colors.txt files a bit. 2015-11-25 11:02:09 +01:00
avgcolor.py Improve scripts & documentation for generating colors.txt files a bit. 2015-11-25 11:02:09 +01:00
init.lua Improve scripts & documentation for generating colors.txt files a bit. 2015-11-25 11:02:09 +01:00
mkcolors Explicitly set the color of xpanes:bar_* only when computing it failed 2015-11-26 12:00:12 +01:00

README.dumpnodes

Generating a colors.txt file
============================

Simple instructions for generating a colors.txt file on unix/linux.

While it is known that generating a colors.txt file is not a
user-friendly experience for those who are not comfortable
using the unix/linux command-line, this is an attempt to make it
as simple and understandable as possible, given the current state
of affairs.

If many of the steps below are cryptic to you, then you might be
better off using an existing colors file, and adding any extra
colors you need by hand.

More experienced users should adapt this procedure to their
own needs.

Note in general that a generated colors.txt file may contain incorrect
or undesirable colors for some nodes, or it may lack transparency
information for nodes.
Manual reviewing (e.g. comparison to an existing colors file)
is recommended.

Steps
=====

(to be performed from the command-line)

1)  A directory 'dumpnodes' (containing this file you are reading,
    as well as some other files) is provided with minetestmapper.
    Copy this directory to the minetest 'mods' directory (i.e.
    install dumpnodes as a mod)
2)  Change to the new (copied) directory (<somelocation>/mods/dumpnodes)
3)  Make sure 'avgcolors.py' and 'mkcolors' are executable. To make them
    executable, issue the command:
	chmod +x avgcolors.py mkcolors
4)  Verify that avgcolors.py works. Type:
	./avgcolors.py
    it should print:
   	Usage: ./avgcolor.py <input>
    Possible reasons for failure:
    - avgcolor.py is not in the current directory
    - avgcolor.py is not executable
    - python is not installed
    - ...?
5)  Verify that mkcolors works. Type:
	./mkcolors
    it should print:
	Usage: mkcolors search-dir [...]
    Possible reasons for failure:
    - mkcolors is not in the current directory
    - mkcolors is not executable
    - avgcolors.py is not in the current directory
    - avgcolors.py does not work, See above.
    - /bin/bash is not installed
    - ...?
6)  Start minetest while in the 'dumpnodes' directory
    (It can be started from another directory, but the resulting
     nodes.txt file will have to be copied to the dumpnodes
     directory in order to perform subsequent steps)
7)  Create a world and load dumpnodes & all mods you want to have a color entry for
8)  Start the world & issue the command '/dumpnodes' wile in the game
    Minetest reports back: '<some number> nodes dumped'
9)  Exit the world
10) In the dumpnodes directory, you'll find a file 'nodes.txt'
    If not, see point 6 above, or find the nodes.txt file, and copy it to the
    dumpnodes directory
11) Make sure you're still in the directory of the dumpnodes mod.
12) Run mkcolors. The first parameter is the minetest directory that contains
    the 'games' and the 'mods' subdirectories.
    Normally that would be two directories up from where you are (../../)
	./mkcolors ../../
    or else, enter something like:
	./mkcolors /path/to/minetest/directory
    NOTE: mkcolors may take some time to run.
13) You should now find a (an updated) colors.txt file alongside the nodes.txt
    file. Copy it to where you want it to be. Your world directory, or the
    minetest directory are good locations; see the minetestmapper documentation
    to learn where and how minetestmapper searches for colors files.
14) Optionally, delete the temporary world that you created.

Things this procedure does not take into account:
- Colors cannot be generated yet based on texture packs.
  (reason: mkcolors would not know which texture pack to select)
  Workaround: specify all directories where to search for node textures
  on the command-line of mkcolors. Omit any directories that should not
  be searched, or their parent directories. E.g.
  	./mkcolors /path/to/mods /path/to/games/minetest /path/to/textures/mytextures
  Be sure to include at least the minetest mods directory and the minetest games
  directory. Specify the directories in the right order: the first texture that is found
  will be used.
- Node colors from mods and games installed in system locations are not automatically
  computed.
  Workaround: create symbolic links to those desired mods or games in your
  personal mods and/or games directories. E.g.:
  	ln -s /usr/share/games/minetest/games/minetest /home/personal/path/to/minetest/games/
  	ln -s /usr/share/games/minetest/mods/some_mod /home/personal/path/to/minetest/mods/
  or specify the additional search locations on the mkcolors command-line:
  	./mkcolors /home/user/minetest /usr/share/games/minetest
- Windows
  Currently, there is no windows version of the relevant scripts. It is recommended
  to use a colors.txt file generated by somebody else.