First commit
|
@ -0,0 +1,3 @@
|
|||
unifieddyes
|
||||
farming
|
||||
plants_lib
|
|
@ -0,0 +1,126 @@
|
|||
local mod = "tulips"
|
||||
tulips_table = {}
|
||||
img = ""
|
||||
tulips_seed_diff = 420420
|
||||
minetest.register_node(mod..":plant", {--register wild plant
|
||||
tile_images = {img},
|
||||
inventory_image = img,
|
||||
description = hue2.." tulip",
|
||||
drop = "",
|
||||
drawtype = "plantlike",
|
||||
paramtype = 'light',
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
visual_scale = 1.3,
|
||||
groups = { snappy = 3,flammable=2, floored=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, -3/16, 0.25 },
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
for i = 1, 12 do
|
||||
local hue = HUES[i]
|
||||
local hue2 = HUES2[i]
|
||||
local img = mod.."_"..hue..".png"
|
||||
print(hue)
|
||||
--farming
|
||||
farming:add_plant(mod..":"..hue, {"tulips:"..hue.."_seeds",mod..":"..hue.."_sprout"}, 60, 2)
|
||||
tulips_table[i] = mod..":"..hue
|
||||
--node
|
||||
--tulip
|
||||
minetest.register_node(mod..":"..hue, {--register wild plant
|
||||
tile_images = {img},
|
||||
inventory_image = img,
|
||||
description = hue.." tulip",
|
||||
drop = {
|
||||
max_items = 3,
|
||||
items = {
|
||||
{ items = {mod..":"..hue.."_seeds"} },
|
||||
{ items = {mod..":"..hue.."_seeds"}, rarity = 2},
|
||||
{ items = {mod..":"..hue.."_seeds"}, rarity = 5},
|
||||
}
|
||||
},
|
||||
drawtype = "plantlike",
|
||||
paramtype = 'light',
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
visual_scale = 1.3,
|
||||
groups = { snappy = 3,flammable=2, floored=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -3/16, -8/16, -3/16, 3/16, 10/16, 3/16 },
|
||||
},
|
||||
})
|
||||
--sprout
|
||||
img = "tulips_sprout.png"
|
||||
minetest.register_node(mod..":"..hue.."_sprout", {--register wild plant
|
||||
tile_images = {img},
|
||||
inventory_image = img,
|
||||
description = hue2.." tulip",
|
||||
drop = "",
|
||||
drawtype = "plantlike",
|
||||
paramtype = 'light',
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
visual_scale = 1.3,
|
||||
groups = { snappy = 3,flammable=2, floored=1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -3/16, -8/16, -3/16, 3/16, 8/16, 3/16 },
|
||||
},
|
||||
})
|
||||
|
||||
--seed
|
||||
img = mod.."_seeds.png"
|
||||
minetest.register_node(mod..":"..hue.."_seeds", {--register wild plant
|
||||
tile_images = {img},
|
||||
inventory_image = img,
|
||||
description = hue.." tulip seeds",
|
||||
drawtype = "nodebox",
|
||||
paramtype = 'light',
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
visual_scale = 1.3,
|
||||
groups = { snappy = 3,flammable=2, floored=1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.45, 0.5}
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.45, -0.5, 0.5, -0.5, 0.5}
|
||||
},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
--craft
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "unifieddyes:" .. hue,
|
||||
recipe = {
|
||||
mod..":" .. hue,
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
--spawning
|
||||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = 1800,
|
||||
spawn_plants = tulips_table,
|
||||
avoid_radius = 10,
|
||||
spawn_chance = 30,
|
||||
spawn_surfaces = {"default:dirt_with_grass"},
|
||||
avoid_nodes = {"group:flower"},
|
||||
seed_diff = tulips_seed_diff,
|
||||
light_min = 9
|
||||
})
|
|
@ -0,0 +1,21 @@
|
|||
_______ __ __ ___ ___ _______ _______
|
||||
| || | | || | | | | || |
|
||||
|_ _|| | | || | | | | _ || _____|
|
||||
| | | |_| || | | | | |_| || |_____
|
||||
| | | || |___ | | | ___||_____ |
|
||||
| | | || || | | | _____| |
|
||||
|___| |_______||_______||___| |___| |_______|
|
||||
|
||||
BY: bas080
|
||||
DESCRIPTION: Obtain dyes more rapidly by farming them
|
||||
VERSION: 0.1
|
||||
LICENSE: WTFPL
|
||||
FORUM: http://forum.minetest.net/viewtopic.php?id=5332
|
||||
|
||||
Changelog
|
||||
---------
|
||||
0.1
|
||||
* Spawn on abm and very rarely (plants_lib)
|
||||
* Drops only seeds
|
||||
* Can be crafted to dyes
|
||||
* Seeds grow into tulips over time (farming)
|
After Width: | Height: | Size: 524 KiB |
After Width: | Height: | Size: 603 KiB |
After Width: | Height: | Size: 568 KiB |
|
@ -0,0 +1,157 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -z "`which convert`" ] ; then {
|
||||
echo "Please install Imagemagick."
|
||||
exit 1
|
||||
} fi
|
||||
|
||||
if [ -z "`which bc`" ] ; then {
|
||||
echo "Please install GNU bc."
|
||||
exit 1
|
||||
} fi
|
||||
|
||||
if [ $1 = "-t" ] ; then {
|
||||
TINT_OVERLAY=$1
|
||||
BASE=$2
|
||||
COMPOSITE=$3
|
||||
} else {
|
||||
TINT_OVERLAY=""
|
||||
BASE=$1
|
||||
COMPOSITE=$2
|
||||
} fi
|
||||
|
||||
if [ -z $1 ] || [ $1 == "--help" ] || [ $1 == "-h" ] || [[ $1 == "-t" && -z $3 ]] ; then {
|
||||
|
||||
echo -e "\nUsage:
|
||||
\ngentextures.sh basename [overlay_filename]
|
||||
gentextures.sh -t basename overlay_filename
|
||||
\nThis script requires up to three parameters which supply the base filename
|
||||
of the textures, an optional overlay, and possibly the '-t' switch. The
|
||||
'basename' is the first part of the filename that your textures will use when
|
||||
your mod is done, which should almost always be the same as the one-word name
|
||||
of your mod. For example, if you supply the word 'mymod', this script will
|
||||
produce filenames like mymod_red.png or 'mymod_dark_blue_s50.png'. The
|
||||
texture that this script will read and recolor is derived from this parameter,
|
||||
and will be of the form 'basename_base.png', i.e. 'mymod_base.png'.
|
||||
\nYou can also supply an optional overlay image filename. This image will be
|
||||
composited onto the output files after they have been colorized, but without
|
||||
being modified. This is useful when you have some part of your base image
|
||||
that will either get changed undesirably (for example, the mortar among
|
||||
several bricks, or the shading detail of a stone pattern). Simply draw two
|
||||
images: one containing the whole image to be colored, and one containing the
|
||||
parts that should not be changed, with either full or partial alpha
|
||||
transparency where the re-colored base image should show through. Skilled use
|
||||
of color and alpha on this overlay can lead to some interesting effects.
|
||||
\nIf you add '-t' as the first parameter, the script will switch to 'tint
|
||||
overlay' mode. For this mode to work, you must also supply the base name as
|
||||
usual, and you must include an overlay image filename. Rather than re-color
|
||||
the base texture, the script will alter the hue/saturation/value of the
|
||||
overlay texture file instead, and leave the base texture unchanged. When
|
||||
using this mode, the base texture should be drawn in some neutral color, but
|
||||
any color is fine if it results in what you wanted.\n"
|
||||
exit 1
|
||||
} fi
|
||||
|
||||
if [[ ! -e $BASE"_base.png" ]]; then {
|
||||
echo -e "\nThe basename '"$BASE"_base.png' was not found."
|
||||
echo -e "\nAborting.\n"
|
||||
exit 1
|
||||
} fi
|
||||
|
||||
if [[ ! -z $COMPOSITE && ! -e $COMPOSITE ]]; then {
|
||||
echo -e "\nThe requested composite file '"$COMPOSITE"' was not found."
|
||||
echo -e "\nAborting.\n"
|
||||
exit 1
|
||||
} fi
|
||||
|
||||
convert $BASE"_base.png" -modulate 1,2,3 tempfile.png 1>/dev/null 2>/dev/null
|
||||
|
||||
if (( $? )) ; then {
|
||||
echo -e "\nImagemagick failed while testing the base texture file."
|
||||
echo -e "\nEither the base file '"$BASE"_base.png' isn't an image,"
|
||||
echo "or it is broken, or Imagemagick itself just didn't work."
|
||||
echo -e "\nPlease check and correct your base image and try again."
|
||||
echo -e "\nAborting.\n"
|
||||
exit 1
|
||||
} fi
|
||||
|
||||
if [ ! -z $COMPOSITE ] ; then {
|
||||
convert $BASE"_base.png" -modulate 1,2,3 $COMPOSITE -composite tempfile.png 1>/dev/null 2>/dev/null
|
||||
|
||||
if (( $? )) ; then {
|
||||
echo -e "\nImagemagick failed while testing the composite file."
|
||||
echo -e "\nEither the composite file '"$COMPOSITE"' isn't an image"
|
||||
echo "or it is broken, or Imagemagick itself just didn't work."
|
||||
echo -e "\nPlease check and correct your composite image and try again."
|
||||
echo -e "\nAborting.\n"
|
||||
exit 1
|
||||
} fi
|
||||
} fi
|
||||
|
||||
rm tempfile.png
|
||||
|
||||
base_colors="red orange yellow lime green aqua cyan skyblue blue violet magenta redviolet"
|
||||
|
||||
echo -e -n "\nGenerating filenames based on "$BASE"_base.png"
|
||||
if [ ! -z $COMPOSITE ] ; then {
|
||||
echo ","
|
||||
echo -n "using "$COMPOSITE" as an overlay"
|
||||
} fi
|
||||
|
||||
if [ ! -z $TINT_OVERLAY ] ; then {
|
||||
echo ","
|
||||
echo -n "and tinting the overlay instead of the base texture"
|
||||
} fi
|
||||
|
||||
echo -e "...\n"
|
||||
|
||||
mkdir -p generated-textures
|
||||
|
||||
function generate_texture () {
|
||||
name=$1
|
||||
h=$2
|
||||
s=$3
|
||||
v=$4
|
||||
if [ -z $TINT_OVERLAY ]; then {
|
||||
if [ -z $COMPOSITE ]; then {
|
||||
convert $BASE"_base.png" -modulate $v,$s,$h "generated-textures/"$BASE"_"$name".png"
|
||||
} else {
|
||||
convert $BASE"_base.png" -modulate $v,$s,$h $COMPOSITE -composite "generated-textures/"$BASE"_"$name".png"
|
||||
} fi
|
||||
} else {
|
||||
convert $COMPOSITE -modulate $v,$s,$h MIFF:- | composite MIFF:- $BASE"_base.png" "generated-textures/"$BASE"_"$name".png"
|
||||
} fi
|
||||
}
|
||||
|
||||
hue=0
|
||||
for color_name in $base_colors ; do
|
||||
hue2=`echo "scale=10; ("$hue"*200/360)+100" |bc`
|
||||
echo $color_name "("$hue" degrees)"
|
||||
echo " dark"
|
||||
generate_texture "dark_"$color_name $hue2 100 33
|
||||
echo " medium"
|
||||
generate_texture "medium_"$color_name $hue2 100 66
|
||||
echo " full"
|
||||
generate_texture $color_name $hue2 100 100
|
||||
echo " light"
|
||||
generate_texture "light_"$color_name $hue2 100 150
|
||||
echo " dark, 50% saturation"
|
||||
generate_texture "dark_"$color_name"_s50" $hue2 50 33
|
||||
echo " medium, 50% saturation"
|
||||
generate_texture "medium_"$color_name"_s50" $hue2 50 66
|
||||
echo " full, 50% saturation"
|
||||
generate_texture $color_name"_s50" $hue2 50 100
|
||||
hue=$((hue+30))
|
||||
done
|
||||
|
||||
echo "greyscales"
|
||||
echo " black"
|
||||
generate_texture black 0 0 15
|
||||
echo " dark grey"
|
||||
generate_texture darkgrey 0 0 50
|
||||
echo " medium grey"
|
||||
generate_texture grey 0 0 100
|
||||
echo " light grey"
|
||||
generate_texture lightgrey 0 0 150
|
||||
echo " white"
|
||||
generate_texture white 0 0 190
|
|
@ -0,0 +1,59 @@
|
|||
#!/bin/bash
|
||||
|
||||
pushd . >/dev/null
|
||||
|
||||
cd textures
|
||||
|
||||
echo -e "\n\nFull-saturation colors:"
|
||||
echo -e "-----------------------\n"
|
||||
|
||||
for i in `ls *dark*.png|grep -v _s50|grep -v paint|grep -v black` ; do
|
||||
rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","`
|
||||
color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'`
|
||||
printf "%-32s %-12s %s\n" "$color" "$rgb" "$i"
|
||||
done |sort
|
||||
|
||||
for i in `ls *medium*.png|grep -v _s50|grep -v paint|grep -v black` ; do
|
||||
rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","`
|
||||
color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'`
|
||||
printf "%-32s %-12s %s\n" "$color" "$rgb" "$i"
|
||||
done |sort
|
||||
|
||||
for i in `ls *.png|grep -v medium |grep -v dark|grep -v _s50|grep -v paint|grep -v black|grep -v titanium` ; do
|
||||
rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","`
|
||||
color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'`
|
||||
printf "%-32s %-12s %s\n" "$color" "$rgb" "$i"
|
||||
done |sort
|
||||
|
||||
|
||||
echo -e "\nLow-saturation colors:"
|
||||
echo -e "----------------------\n"
|
||||
|
||||
for i in `ls *dark*_s50.png|grep -v paint|grep -v black` ; do
|
||||
rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","`
|
||||
color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'`
|
||||
printf "%-32s %-12s %s\n" "$color" "$rgb" "$i"
|
||||
done |sort
|
||||
|
||||
for i in `ls *medium*_s50.png|grep -v paint|grep -v black` ; do
|
||||
rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","`
|
||||
color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'`
|
||||
printf "%-32s %-12s %s\n" "$color" "$rgb" "$i"
|
||||
done |sort
|
||||
|
||||
for i in `ls *_s50.png|grep -v dark|grep -v medium|grep -v paint|grep -v black` ; do
|
||||
rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","`
|
||||
color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'`
|
||||
printf "%-32s %-12s %s\n" "$color" "$rgb" "$i"
|
||||
done |sort
|
||||
|
||||
echo -e "\nGreyscale:"
|
||||
echo -e "----------\n"
|
||||
|
||||
printf "%-32s %-12s %s\n" "black" " 0, 0, 0" "unifieddyes_black.png"
|
||||
printf "%-32s %-12s %s\n" "dark grey" " 64, 64, 64" "unifieddyes_darkgrey_paint.png"
|
||||
printf "%-32s %-12s %s\n" "medium grey" "128,128,128" "unifieddyes_grey_paint.png"
|
||||
printf "%-32s %-12s %s\n" "light grey" "192,192,192" "unifieddyes_lightgrey_paint.png"
|
||||
printf "%-32s %-12s %s\n" "white" "255,255,255" "unifieddyes_white_paint.png"
|
||||
|
||||
popd >/dev/null
|
After Width: | Height: | Size: 463 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 266 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 531 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 464 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 353 B |