1
0
mirror of https://github.com/mt-mods/unifieddyes.git synced 2025-06-28 14:26:21 +02:00

Rewrote the bottom part of the README concerning the modding template. Removed

files related to it, since they're exclusively part of the modding template
distribution now.
This commit is contained in:
Vanessa Ezekowitz
2012-07-15 13:43:41 -04:00
parent ced9969e2b
commit f19c11e92f
4 changed files with 61 additions and 648 deletions

111
README
View File

@ -120,56 +120,8 @@ the item names follow the same format as the filenames, save for having a colon
(:) instead of the first underscore (_).
Semi-automatic generation of new textures
=========================================
Obviously, in order for this mod to be useful, you'll need textures to use with
your crafting recipes. If you plan to support the entire range of colors
supplied by this mod, there is a BASH script included in the distribution
directory, named gentextures.sh, which will, with an appropriately- colored and
appropriately-named source texture, generate a complete set of colored and
greyscale textures based on that first one.
This script requires bc (the calculator program) to handle some basic math
regarding the hue adjustments, and Imagemagick's "convert" program handles all
of the actual conversions.
To make this script for your mod, open it in your favorite editor and change
the TEXTURE variable near the top of the file to whatever your particular mod
will use as the basis of its texture filenames. For example, the default is
cotton, so the files created by the script will be named cotton_xxxxxx.png for
each of the supported colors.
Then, using your favorite image editor, create a single version of your desired
texture. Draw it in the brightest, deepest shade of RED you can muster without
losing any detail, and save it out. Ideally, you will want the average color
of the texture, when taking into account all bright and dark areas, to be as
close as possible to the hex value #FF0000 (0 degrees, 100% saturation, pure
red) without losing any appreciable #detail
Save this source texture out with a filename of red_base_whatever.png, where
"whatever" is the same name you used in the TEXTURE variable above. The
default cotton setting, thus, would need a filename of red_base_cotton.png.
Copy the gentextures.sh script to the same directory where you placed the base
texture, chmod 755 gentextures.sh if necessary, and run it using the usual
dot-slash notation: ./gentextures.sh
The program will exit immediately if it can't find the base texture it needs
(i.e. if you didn't supply it, or if you named it wrong, or if it isn't it in
the same directory as the script).
Otherwise, the program will create a new folder named generated-textures/ and
then iterate through all of the hues and shades that are supported by
unifieddyes (though this is done manually, not by reading anything from the
mod). All of the output files will be placed in that folder.
Use your favorite image browser or file manager to review the results, and if
they're right, copy them over to the textures/ folder in your mod.
Example Code
============
Semi-automatic generation of nodes, crafting recipes, and textures
==================================================================
Along with this mod, you should also download my modding template, which is
quite easy to transform into whatever mod you want to create that needs
@ -191,3 +143,62 @@ fetch it separately from here:
Download Template: https://github.com/VanessaE/modtemplate/zipball/master
...or browse the code: https://github.com/VanessaE/modtemplate
Semi-automatic generation of new textures
=========================================
Obviously, in order for this mod or the above template to be useful, you'll
need textures. If you plan to support the entire range of colors offered by
Unified Dyes, there is a BASH script included with that template named
gentextures.sh, which will, with an appropriately- colored and
appropriately-named source texture, and possibly an overlay texture, generate a
complete set of colored and greyscale textures.
The script requires bc (the calculator program) to handle some basic math
regarding the hue adjustments, and Imagemagick's "convert" program handles all
of the actual conversions.
First thing's first though - you need source textures. Using your favorite image
editor, create a single version of your desired texture. Draw it in the
brightest, deepest shade of RED you can muster without losing any detail, and
save it out. Ideally, you will want the average color of the texture, when
taking into account all bright and dark areas, to be as close as possible to
the hex value #FF0000 (0 degrees, 100% saturation, pure red) without losing any
appreciable #detail.
Save this source texture out with a filename of red_base_whatever.png, where
"whatever" is the same name you used in the TEXTURE variable above. The
default cotton setting, thus, would need a filename of red_base_cotton.png.
If you want to add an image on top of the colored blocks, such as a frame,
which you want to be the same color throughout all of the textures, create it
now. It should consist only of those parts of the textures that you want to
leave unchanged, with transparency everywhere else. Save it out using any
filename you want.
Now, run the script (make it executable first, if necessary).
If you didn't need the overlay, you just need to supply one command line
argument: the base name of your mod. The script will use that parameter as the
basis of its texture filenames. For example:
./gentextures.sh mymod
If you want to use an overlay also, run the script with the base name as the
first parameter, and the complete filename of your overlay as the second. For
example:
./gentextures.sh mymod myoverlay.png
The program will exit immediately if the image(s) you've supplied are invalid,
missing, etc.
Otherwise, the program will iterate through all of the hues and shades that are
supported by unifieddyes (though this is done manually, not by reading anything
from the mod), compositing your overlay image in after the recolor step, if
you're using that option.
All of the output files will be placed in a new folder, generated-textures/
Use your favorite image browser or file manager to review the results, and if
they're right, copy them over to the textures/ folder in your mod.