Rogier-5 / minetest-mapper-cpp

Generates maps of minetest and freeminer worlds
Other
9 stars 4 forks source link

Suggestion - Add Instructions for How to Use the autogenerating-colors.txt File #7

Open LazyJ opened 8 years ago

LazyJ commented 8 years ago

Howdy, Rogier-5 ;)

I noticed the autogenerating-colors.txt file when I recompiled the mapper recently. How to make use of it is not very clear, at least for those of us who aren't experts with python and the terminal in general.

My suggestion would be to add much clearer instructions into the manual.rst as to what commands to use and where to put the files that the autogenerating-colors.txt file describes.

Taking it a step further, create the dumpnodes mod, the python script, and whatever that last part under the "==COMMAND==" section is and include them in a subdirectory of minetest-mapper-cpp. Perhaps under "utils"?

Looking through the text of autogenerating-colors.txt, I figured out the top section is to manually create a mod called "dumpnodes" with its own init.lua file. That mod generated "nodes.txt" in my home folder. I see a the very bottom of the text file is a note to include the path. Is the path info supposed to entered after the "/dumpnodes" command in Minetest _(ie. "/dumpnodes ~/minetest_stuff/minetestmapper/")?

The python part and the rest of the text is where I get stuck. I created a avgcolor.py file using the text between "==FILE== avgcolor.py" and "==COMMAND==", and set that file to executable.

It is at this point where I can't figure out how to generate the colors.txt file.

Is the stuff under "==COMMAND==" another file or is it part of the avgcolor.py script? If it is part of that script, it hangs at the end and no colors.txt file is created. When I run the text below "==COMMAND==" and "==INSTRUCTIONS==" in the terminal, I get an error about the syntax of "while read -r p; do" with a caret under the "p".

Note: When copy/pasting the text into separate files, I removed the "==FILE== mods/dumpnodes/init.lua", "==COMMAND==", and "==INSTRUCTIONS==" (and the preceding 5 instruction steps), from each file.

What the steps to get this last part to work properly?

Thanks,

~ LazyJ

Rogier-5 commented 8 years ago

Hi LazyJ,

I agree the colors file generation needs some improvement and documentation... I've been thinking about it, but making it dependable and reasonably fault-tolerant requires some work...

In the mean time, I split up autogenerating-colors.txt in several scripts, polished them a bit, and added some more documentation. It's not perfect yet, but I think it's an improvement.

BTW, if you're still interested: I think you got all steps right. The part under ==COMMAND== was (indeed) intended to be run in a terminal. Or to be in its own script file (which is equivalent). ATM I don't understand why you got the error...