[Mod] Unified Dyes [20170620][unifieddyes]

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Nordal » Post

I know what you mean. But there's definitely no secon place.
I've got only one unifieddyes' folder and made the

Code: Select all

print(dump(newrecipe))
addition at line 266 there directly.

I added a

Code: Select all

minetest.log("action"," ---- Unifieddyes is Loading! ---- ")
statement at the beginning of unifieddyes' init.lua.
It's printed into debug.txt. That means, unfieddyes must have been loaded, I think.

Code: Select all

-------------
  Separator
-------------

2019-07-07 13:43:28: WARNING[Main]: Mod name conflict detected: "farming"
2019-07-07 13:43:28: WARNING[Main]: Will not load: /home/roland/minetest-5.0.1/bin/../games/minetest_game/mods/farming
2019-07-07 13:43:28: WARNING[Main]: Overridden by: /home/roland/minetest-5.0.1/bin/../mods/farming
2019-07-07 13:43:28: ACTION[Main]: hb.register_hudbar: health
2019-07-07 13:43:28: ACTION[Main]: hb.register_hudbar: breath
2019-07-07 13:43:28: ACTION[Main]: New font registered in font_api: metro.
2019-07-07 13:43:28: ACTION[Main]: [Mod] Soft Leaves [v0.1.0] loaded.
2019-07-07 13:43:28: ACTION[Main]: New font registered in font_api: tinycurs.
2019-07-07 13:43:29: ACTION[Main]: hb.register_hudbar: armor
2019-07-07 13:43:29: WARNING[Main]: 3d_armor_ip: Mod loaded but unused.
2019-07-07 13:43:29: ACTION[Main]: hb.register_hudbar: thirst
2019-07-07 13:43:29: ACTION[Main]:  ---- Unifieddyes is Loading! ---- 
2019-07-07 13:43:29: ACTION[Main]:  ---- Dark Age Version 1.3 is Loading! ---- 
2019-07-07 13:43:29: ERROR[Main]: ModError: Failed to load and run script from /home/roland/minetest-5.0.1/bin/../mods/darkage/init.lua:
2019-07-07 13:43:29: ERROR[Main]: Invalid crafting recipe (output="darkage:milk_glass 1 0 "\u0001palette_index\u00020\u0003"")
2019-07-07 13:43:29: ERROR[Main]: stack traceback:
2019-07-07 13:43:29: ERROR[Main]: 	[C]: in function 'register_craft'
2019-07-07 13:43:29: ERROR[Main]: 	...e/roland/minetest-5.0.1/bin/../mods/unifieddyes/init.lua:287: in function 'register_c'
2019-07-07 13:43:29: ERROR[Main]: 	...e/roland/minetest-5.0.1/bin/../mods/unifieddyes/init.lua:317: in function 'register_color_craft'
2019-07-07 13:43:29: ERROR[Main]: 	...d/minetest-5.0.1/bin/../mods/darkage/glass_rewritten.lua:174: in main chunk
2019-07-07 13:43:29: ERROR[Main]: 	[C]: in function 'dofile'
2019-07-07 13:43:29: ERROR[Main]: 	/home/roland/minetest-5.0.1/bin/../mods/darkage/init.lua:12: in main chunk
2019-07-07 13:43:29: ERROR[Main]: Check debug.txt for details.
2019-07-07 13:43:29: ACTION[Main]: Server: Shutting down
2019-07-07 13:46:48: ERROR[Main]: Please choose a name!
I tried a fresh installed MT 5.0 with unifieddesy, darkage, farming (of TenPlus1) and unified_inventory, but the result is the same. :-(

EDIT: After another try I found something new in my terminal's output, right after "Loading unifieddyes":

Code: Select all

roland@r-pc:~/minetest-5.0.1/bin$ ./minetest
Loaded texture: /home/roland/minetest-5.0.1/textures/base/pack/menu_header.png
Loaded texture: /home/roland/minetest-5.0.1/games/minetest_game/screenshot.png
Loaded texture: /home/roland/minetest-5.0.1/textures/base/pack/logo.png
Loaded texture: /home/roland/minetest-5.0.1/games/minetest_game/menu/header.png
Loaded texture: /home/roland/minetest-5.0.1/games/minetest_game/menu/icon.png
Loaded texture: /home/roland/minetest-5.0.1/games/minimal/menu/icon.png
Loaded texture: /home/roland/minetest-5.0.1/textures/base/pack/menu_header.png
Loaded texture: /home/roland/minetest-5.0.1/games/minetest_game/menu/header.png
2019-07-07 13:43:28: WARNING[Main]: Mod name conflict detected: "farming"
2019-07-07 13:43:28: WARNING[Main]: Will not load: /home/roland/minetest-5.0.1/bin/../games/minetest_game/mods/farming
2019-07-07 13:43:28: WARNING[Main]: Overridden by: /home/roland/minetest-5.0.1/bin/../mods/farming
2019-07-07 13:43:28: ACTION[Main]: hb.register_hudbar: health
2019-07-07 13:43:28: ACTION[Main]: hb.register_hudbar: breath
2019-07-07 13:43:28: ACTION[Main]: New font registered in font_api: metro.
2019-07-07 13:43:28: ACTION[Main]: [Mod] Soft Leaves [v0.1.0] loaded.
Error: Could not open bell data savefile (ignore this message on first start)
2019-07-07 13:43:28: ACTION[Main]: New font registered in font_api: tinycurs.
[Ropes] Loaded!
[MOD] bonemeal loaded
[MOD] Wine geladen
[3d_armor] Fire Nodes disabled
2019-07-07 13:43:29: ACTION[Main]: hb.register_hudbar: armor
2019-07-07 13:43:29: WARNING[Main]: 3d_armor_ip: Mod loaded but unused.
2019-07-07 13:43:29: ACTION[Main]: hb.register_hudbar: thirst
2019-07-07 13:43:29: ACTION[Main]:  ---- Unifieddyes is Loading! ---- 
[UnifiedDyes] geladen!
2019-07-07 13:43:29: ACTION[Main]:  ---- Dark Age Version 1.3 is Loading! ---- 
{
	"",
	"dye:faint_red"
}
2019-07-07 13:43:29: ERROR[Main]: ModError: Failed to load and run script from /home/roland/minetest-5.0.1/bin/../mods/darkage/init.lua:
2019-07-07 13:43:29: ERROR[Main]: Invalid crafting recipe (output="darkage:milk_glass 1 0 "\u0001palette_index\u00020\u0003"")
2019-07-07 13:43:29: ERROR[Main]: stack traceback:
2019-07-07 13:43:29: ERROR[Main]: 	[C]: in function 'register_craft'
2019-07-07 13:43:29: ERROR[Main]: 	...e/roland/minetest-5.0.1/bin/../mods/unifieddyes/init.lua:287: in function 'register_c'
2019-07-07 13:43:29: ERROR[Main]: 	...e/roland/minetest-5.0.1/bin/../mods/unifieddyes/init.lua:317: in function 'register_color_craft'
2019-07-07 13:43:29: ERROR[Main]: 	...d/minetest-5.0.1/bin/../mods/darkage/glass_rewritten.lua:174: in main chunk
2019-07-07 13:43:29: ERROR[Main]: 	[C]: in function 'dofile'
2019-07-07 13:43:29: ERROR[Main]: 	/home/roland/minetest-5.0.1/bin/../mods/darkage/init.lua:12: in main chunk
2019-07-07 13:43:29: ERROR[Main]: Check debug.txt for details.
2019-07-07 13:43:29: ACTION[Main]: Server: Shutting down
Loaded texture: /home/roland/minetest-5.0.1/games/minetest_game/menu/header.png
Loaded texture: /home/roland/minetest-5.0.1/games/minetest_game/menu/icon.png
Loaded texture: /home/roland/minetest-5.0.1/games/minimal/menu/icon.png
Quit message received.
2019-07-07 13:46:48: ERROR[Main]: Please choose a name!
roland@r-pc:~/minetest-5.0.1/bin$ 
Maybe that helps?
CFS - still widely unknown

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by VanessaE » Post

I think I know what's wrong. Took a while for it to percolate. :-P

I see three errors:

1. As with the standard minetest.register_craft() call, if you don't set the recipe type in the color craft helper, it defaults to a regular shaped recipe, i.e. where ingredients have to be in specific positions in the crafting grid to make the craft produce an output. But the form you gave of the recipe ingredients is clearly shapeless. You need to put type = "shapeless", alongside the other items (outside the recipe, perhaps just below the palette entry).

2. NEUTRAL_NODE (in all caps) is just a placeholder, as you might use in a word processor database report document. It is set to the contents of the neutral_node (all lowercase) item above it at runtime, but you set that to an empty string, so you're getting empty strings in a shapeless recipe, which I don't think is valid. The purpose of the placeholder to make the placement of the colorized item easily-visible among the recipe ingredients, should you have a lot of them, and reduces the possibility of typos if you should need to use more than one of that item, but that doesn't seem to be your intent. Since you probably only wanted one of the glass item in the recipe, just replace NEUTRAL_NODE (all caps) with the item name.

3. You don't need the on_construct in your node definition. Got rid of that a long time ago. That the API mentioned it is an error on my part (now fixed). Just delete that item from the node definition altogether.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Nordal » Post

Percolate is a nice new word for my vocabulary :-)
I fixed the errors you identified. And we made a great step forward. It runs!
Big Thank you for this!

But:
I gave me "/giveme" priv and positioned a milk_glass_round item on the floor. I can open the airbrushes' form, but I cannot choose a color. :-(
No matter what kind of darkage glass I try to colorize.

The "mix" area of unified_dyes offers 128 possible colors in shape of dyes. But I can't do anything with it except moving the milk_glass item to the recipe area, uncolored.

It's uncomfortable to read for you, I'm sorry, but I put here the whole code of glass_rewritten.lua. May you see a mistake that does not produce an error but that may be responsible for the current problem. I'm not sure, if the replacement of NEUTRAL_NODE is correct. I may should write "darkage:milk_glass" instead of "darkage:stained_milk_glass?

Code: Select all

--[[
	Medival glasses.
	The glasses can be colorized using dye. 
	Colorization requires unifieddyes installed.

	Special thanks to Semmett9 for the glass textures.
]]

--[[ Rhombus Glass ]]

minetest.register_node("darkage:glass", {
	description = "Clean Medieval Glass",
	drawtype = "glasslike",
	tiles = {"darkage_glass.png"},
	use_texture_alpha=false,
	paramtype = "light",
	sunlight_propagates = true,
	groups = {cracky = 3, oddly_breakable_by_hand = 3, not_cuttable=1},
	sounds = default.node_sound_glass_defaults(),
})

minetest.register_craft({
	output = "darkage:glass 8",
	recipe = {
		{"default:glass", "default:steel_ingot", "default:glass"},
		{"default:steel_ingot", "default:glass", "default:steel_ingot"},
		{"default:glass", "default:steel_ingot", "default:glass"},
	}
})

--[[ Round Glass By Semmett9 aka Infinatum ]]

minetest.register_node("darkage:glass_round", {
	description = "Round Glass",
	drawtype = "glasslike",
	tiles = { "darkage_glass_round.png" },
	paramtype = "light",
	use_texture_alpha = true,
	sunlight_propagates = true,
	sounds = default.node_sound_glass_defaults(),
	groups = {cracky=3,oddly_breakable_by_hand=3},
})

minetest.register_craft({
	output = "darkage:glass_round 8",
	recipe = {
		{"default:steel_ingot", "default:glass", "default:steel_ingot"},
		{"default:glass", "default:glass", "default:glass"},
		{"default:steel_ingot", "default:glass", "default:steel_ingot"},
	}
})

--[[ Square glass By Semmett9 aka Infinatum ]]

minetest.register_node("darkage:glass_square", {
	description = "Square Glass",
	drawtype = "glasslike",
	tiles = { "darkage_glass_square.png" },
	paramtype = "light",
	use_texture_alpha = true,
	sunlight_propagates = true,
	sounds = default.node_sound_glass_defaults(),
	groups = {cracky=3,oddly_breakable_by_hand=3},
})

minetest.register_craft({
	output = "darkage:glass_square 8",
	recipe = {
		{"default:glass",		"default:steel_ingot", "default:glass"},
		{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
		{"default:glass",		"default:steel_ingot", "default:glass"},
	}
})

--[[
		Glowing Glass Variants

		]]

--[[ Rhombus Glow Glass ]]

minetest.register_node("darkage:glow_glass", {
	description = "Medieval Glow Glass",
	drawtype = "glasslike",
	tiles = {"darkage_glass.png"},
	use_texture_alpha=true,
	paramtype = "light",
	sunlight_propagates = true,
	light_source = default.LIGHT_MAX-1,
	groups = {cracky = 3, oddly_breakable_by_hand = 3, not_cuttable=1},
	sounds = default.node_sound_glass_defaults(),
})

-- Craft
minetest.register_craft({
	output = "darkage:glass 1",
    type = "shapeless",
	recipe = {"darkage:glow_glass"},
})

-- Recycling
minetest.register_craft({
	output = "darkage:glow_glass 1",
	recipe = {
		{"darkage:glass"},
		{"default:torch"},
	}
})
--[[ TODO
-- Round Glow Glass

minetest.register_node("darkage:glow_glass_round", {
	description = "Medieval Round Glow Glass",
	drawtype = "glasslike",
	tiles = {"darkage_glass_round.png"},
	use_texture_alpha=true,
	paramtype = "light",
	sunlight_propagates = true,
	light_source = default.LIGHT_MAX-1,
	groups = {cracky = 3, oddly_breakable_by_hand = 3, not_cuttable=1},
	sounds = default.node_sound_glass_defaults(),
})

-- Craft
minetest.register_craft({
	output = "darkage:glass_round 1",  --TODO
	recipe = {
		{"darkage:glow_glass"},
	}
})

-- Recycling
minetest.register_craft({
	output = "darkage:glow_glass 1",
	recipe = {
		{"darkage:glass"},
		{"default:torch"},
	}
})
TODO  --]]



--[[
		Colorizable Milk Glass Variants, depending on unifieddyes mod

		]]

if minetest.get_modpath("unifieddyes") then

	--[[ Rhombus Milk Glass ]]

	minetest.register_node("darkage:milk_glass", {
		description = "Milky Medieval Glass (Good for colorization)",
		drawtype = "glasslike",
		tiles = {"darkage_milk_glass.png"},
		use_texture_alpha=true,
		paramtype = "light",
		paramtype2 = "color",
		palette = "unifieddyes_palette_extended.png",
		sunlight_propagates = true,
		groups = {cracky = 3, oddly_breakable_by_hand = 3, not_cuttable=1, ud_param2_colorable = 1},
		sounds = default.node_sound_glass_defaults()
	})

	minetest.register_craft({
		output = "darkage:milk_glass",
		type = "shapeless",
		recipe = {"darkage:glass", "dye:white"}
	})

    unifieddyes.register_color_craft({
        output = "darkage:milk_glass",
        palette = "extended",
        type = "shapeless",
        neutral_node = "",
        recipe = {
                 "darkage:stained_milk_glass",
                 "MAIN_DYE"
        }
    })

    -- Recycling
	minetest.register_craft({
		output = "darkage:glass 1",
		recipe = {{"darkage:milk_glass"}}
	})

	--[[ Round Milk Glass ]]

	minetest.register_node("darkage:milk_glass_round", {
		description = "Milky Medieval Round Glass (Good for colorization)",
		drawtype = "glasslike",
		tiles = {"darkage_milk_glass_round.png"},
		use_texture_alpha=true,
		paramtype = "light",
		paramtype2 = "color",
		palette = "unifieddyes_palette_extended.png",
		sunlight_propagates = true,
		groups = {cracky = 3, oddly_breakable_by_hand = 3, not_cuttable=1, ud_param2_colorable = 1},
		sounds = default.node_sound_glass_defaults()
	})
	-- Craft
	minetest.register_craft({
		output = "darkage:milk_glass_round",
		type = "shapeless",
		recipe = {"darkage:glass_round", "dye:white"},
	})

    unifieddyes.register_color_craft({
        output = "darkage:milk_glass_round",
        palette = "extended",
        type = "shapeless",
        neutral_node = "",
        recipe = {
                 "darkage:milk_glass_round",
                 "MAIN_DYE"
        }
    })

	-- Recycling
	minetest.register_craft({
		output = "darkage:glass_round 1",
		recipe = {{"darkage:milk_glass_round"}}
	})

	--[[ Square Milk Glass ]]

	minetest.register_node("darkage:milk_glass_square", {
		description = "Milky Medieval Square Glass (Good for colorization)",
		drawtype = "glasslike",
		tiles = {"darkage_milk_glass_square.png"},
		use_texture_alpha=true,
		paramtype = "light",
		paramtype2 = "color",
		palette = "unifieddyes_palette_extended.png",
		sunlight_propagates = true,
		groups = {cracky = 3, oddly_breakable_by_hand = 3, not_cuttable=1, ud_param2_colorable = 1},
        on_construct = unifieddyes.on_construct,
		sounds = default.node_sound_glass_defaults()
	})

	-- Craft
	minetest.register_craft({
		output = "darkage:milk_glass_square",
		type = "shapeless",
		recipe = {"darkage:glass_square", "dye:white"},
	})

	unifieddyes.register_color_craft({
	output = "darkage:milk_glass_square",
	palette = "extended",
	type = "shapeless",
	neutral_node = "",
	recipe = {
			 "darkage:stained_milk_glass_square",
			 "MAIN_DYE"
		}
	})

	-- Recycling
	minetest.register_craft({
		output = "darkage:glass_square",
		recipe = {{"darkage:milk_glass_square"}}
	})

end --unifieddyes condition
CFS - still widely unknown

User avatar
addi
Member
Posts: 666
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by addi » Post

ERROR[Main]: generateImage(): Could not load image "unifieddyes_palette.png" while building texture; Creating a dummy image
Its missing in the texture folder. https://gitlab.com/VanessaE/unifieddyes ... r/textures

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Nordal » Post

Hello addi, as you see I'm trying to repair and update glass.lua of your darkage mod with help of Vanessa. I didn't associate you with adrido. It's a bit confusing that there exist two darkage mods. I realized that you hold the newest fork ahead. My purpose is to make the medieval glass panes shine again in every color.
ERROR[Main]: generateImage(): Could not load image "unifieddyes_palette.png" while building texture; Creating a dummy image
Its missing in the texture folder.
In my new version of glass.lua I replaced this palette by the extended one to get more colors. I now just get a warning which I supose to be harmless

Code: Select all

2019-07-08 17:48:07: WARNING[Main]: TextureSource::getPalette(): the specified palette image "unifieddyes_palette_extended.png" is larger than 256 pixels, using the first 256.
There must be another reason for the current problem. See my above post.
CFS - still widely unknown

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by VanessaE » Post

That "larger than 256 pixels" thing is an unrelated warning and is completely harmless. It's just a byproduct of the way I formatted the image. As for the rest, I don't know what's wrong.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Nordal » Post

Wow, it works!

You must have the dye you want the glass to be stained with in your inventory.
Then you can use the airbrush, choose the color and paint the glass.

Thank you for your help, Vanessa!
CFS - still widely unknown

User avatar
Inky_Bendy
Member
Posts: 19
Joined: Wed Jan 15, 2020 21:22
In-game: Inky_Bendy

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Inky_Bendy » Post

I can't seem to make light grey dye; when I do the recipe it only makes normal grey dye. However, all the other dye recipes work fine.
Attachments
All the mods I have
All the mods I have
list of mods.png (45.35 KiB) Viewed 2061 times
The recipe won't work.
The recipe won't work.
Minetest 5.1.0 [OpenGL 4.5.0] 1_29_2020 1_38_57 PM.png (569.44 KiB) Viewed 2061 times

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Nordal » Post

I want to make a coat of arms mod. It shall contain a neutral pattern and user can fill the pattern with two different colors. I want to achieve this with help of unifieddyes. I started to write the code but now I got stuck, because I don't know how to make the pattern in a way that it can be filled with color by airbrush. EDIT: The main question is, how can I fill only the front tile with two colors - overlay, mask? Can unifieddyes handle them? /EDIT Would you help me again? You can find the code I wrote so far here https://github.com/Nordall/coats_of_arms.
For this time I placed it inline, too:

Code: Select all

local tile_back = "default:steel_ingot.png"
local tile_side = tile_back
local tile_front = "x" --TODO

minetest.register_node("coats_of_arms:two_color_vertical_neutral", {
	description = "Coats of Arms Two Colored Vertical",
	--up (+Y), down (-Y), right (+X), left (-X), back (+Z), front (-Z).
	tiles = {
		tile_side, tile_side, tile_side, tile_side,
		tile_back,
		tile_front
	},
	drawtype = "nodebox",
	--use_texture_alpha = true, ???
	paramtype = "light",
	paramtype2 = "color",
	palette = "unifieddyes_palette_extended.png",
	groups = {cracky = 3, ud_param2_colorable = 1},
	sounds = default.node_sound_metal_defaults(),
	node_box = {
		type = "fixed",
		fixed = {
			{-0.0625, -0.5, 0.25, 0.0625, -0.46875, 0.5}, -- NodeBox1
			{-0.09375, -0.46875, 0.25, 0.09375, -0.4375, 0.5}, -- NodeBox2
			{-0.1875, -0.4375, 0.25, 0.1875, -0.40625, 0.5}, -- NodeBox3
			{-0.28125, -0.40625, 0.25, 0.28125, -0.375, 0.5}, -- NodeBox4
			{-0.34375, -0.375, 0.25, 0.34375, -0.34375, 0.5}, -- NodeBox5
			{-0.375, -0.34375, 0.25, 0.375, -0.3125, 0.5}, -- NodeBox6
			{-0.40625, -0.3125, 0.25, 0.40625, -0.28125, 0.5}, -- NodeBox7
			{-0.40625, -0.28125, 0.25, 0.40625, -0.25, 0.5}, -- NodeBox8
			{-0.4375, -0.25, 0.25, 0.4375, -0.21875, 0.5}, -- NodeBox9
			{-0.4375, -0.21875, 0.25, 0.4375, -0.1875, 0.5}, -- NodeBox10
			{-0.46875, -0.1875, 0.25, 0.46875, -0.15625, 0.5}, -- NodeBox11
			{-0.46875, -0.15625, 0.25, 0.46875, -0.125, 0.5}, -- NodeBox12
			{-0.46875, -0.125, 0.25, 0.46875, -0.09375, 0.5}, -- NodeBox13
			{-0.5, -0.09375, 0.25, 0.5, -0.0625, 0.5}, -- NodeBox14
			{-0.5, -0.0625, 0.25, 0.5, 0.5, 0.5}, -- NodeBox15
		}
	}
	selection_box = {
			type = "fixed",
			fixed = {
				{-0.500000,-0.500000,0.25000,0.500000,0.500000,0.500000},
			},
		},
})

minetest.register_craft({
	output = "coats_of_arms:two_color_vertical_neutral",
	recipe = {
		{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
		{""                   , "default:steel_ingot", ""},
		{"","dye:white",""}

	}
})

unifieddyes.register_color_craft({
    output = "coats_of_arms:two_color_vertical",
    palette = "extended",
    type = "shapeless",
    neutral_node = "coats_of_arms:two_color_vertical_neutral",
    recipe = {"NEUTRAL_NODE", "MAIN_DYE"},
})
Attachments
Example for pattern
Example for pattern
545px-Blason_Thonon-les-Bains.svg.png (45.62 KiB) Viewed 2061 times
CFS - still widely unknown

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by VanessaE » Post

In your node def, you need to do something like this:

Code: Select all

tiles = {
    {name = tile_side, color = "white"},
    {name = tile_side, color = "white"},
    {name = tile_side, color = "white"},
    {name = tile_side, color = "white"},
    {name = tile_back, color = "white"},
    tile_front
}
overlay_tiles = {
    some_blank_image,
    some_blank_image,
    some_blank_image,
    some_blank_image,
    some_blank_image,
    { name = "your static overlay", color = "white" }
}
...if I remember the overlay function right. The overlay_tiles works the same as the tiles field, i.e. 6 texture entries in a specific order.

"white" must be in quotes. Since the color specified here is multiplied against the texture image, white just creates the same image as the original texture. Think of it as "don't param2-re-colorize this texture entry". If you prefer hex instead of words, you can also do name = foo, color = 0xFFFFFFFF.

Same goes for the overlay image, so you can have a static overlay with a colorized background. That's how it works in the unified bricks mod, for example. Grey, speckled mortar overlay, colorized bricks background. You can also do the reverse, param2-colorizing the overlay, while leaving the background uncolored. This is how the blox mod works.

In the overlay, some_blank_image is just that - an empty image. 1x1 pixel, any color palette, totally alpha transparent. That way only one side of the node gets a meaningful overlay.

Note that you can only use the extended palette on nodes that don't rotate. Engine limitation. But you've covered that here.

As an aside: I noticed you had use_texture_alpha in there, but commented-out and in question. You don't need that unless your overlay image contains translucent parts meant to blend smoothly with the background texture (rather than pixels either being purely on/opaque or off/transparent).

The rest of your code seems right on a cursory look.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Nordal » Post

Thank you for your instant reply and explanation!
"white" must be in quotes. Since the color specified here is multiplied against the texture image, white just creates the same image as the original texture. Think of it as "don't param2-re-colorize this texture entry". If you prefer hex instead of words, you can also do name = foo, color = 0xFFFFFFFF.
Understood.
Same goes for the overlay image, so you can have a static overlay with a colorized background. That's how it works in the unified bricks mod, for example. Grey, speckled mortar overlay, colorized bricks background. You can also do the reverse, param2-colorizing the overlay, while leaving the background uncolored. This is how the blox mod works.
Not fully understood. Does "static" mean in consequence, that I can have a colorized background, but I can't change the overlay's color it with the airbrush (or vice versa)?
In the overlay, some_blank_image is just that - an empty image. 1x1 pixel, any color palette, totally alpha transparent. That way only one side of the node gets a meaningful overlay.
In my case the front side of the node. Done.
As an aside: I noticed you had use_texture_alpha in there, but commented-out and in question. You don't need that unless your overlay image contains translucent parts meant to blend smoothly with the background texture (rather than pixels either being purely on/opaque or off/transparent).
Thank you for the explanation.

Unfortunately the inventory image does not look like it should. I made a screenshot showing the shape of the node in default:wood on the left and the result of my efforts on the right.
comparison
comparison
shape.png (3.74 KiB) Viewed 2061 times
Do you know, what I did wrong?

Code: Select all

coats_of_arms = {}

local tile_back = "default_steel_ingot.png"
local tile_side = tile_back
local tile_front = "dye_red.png"

minetest.register_node("coats_of_arms:two_color_vertical_neutral", {
	description = "Coats of Arms Two Colored Vertical",
	--up (+Y), down (-Y), right (+X), left (-X), back (+Z), front (-Z).
	tiles = {
    	{name = tile_side, color = "white"},
    	{name = tile_side, color = "white"},
    	{name = tile_side, color = "white"},
    	{name = tile_side, color = "white"},
    	{name = tile_back, color = "white"},
    	tile_front
	},
	overlay_tiles = {
    	"coats_of_arms_empty_image.png",
		"coats_of_arms_empty_image.png",
		"coats_of_arms_empty_image.png",
		"coats_of_arms_empty_image.png",
		"coats_of_arms_empty_image.png",
    	{ name = "coats_of_arms_static_overlay.png", color = "white" },
	},
	drawtype = "nodebox",
	paramtype = "light",
	paramtype2 = "color",
	palette = "unifieddyes_palette_extended.png",
	groups = {cracky = 3, ud_param2_colorable = 1},
	sounds = default.node_sound_metal_defaults(),
	node_box = {
		type = "fixed",
		fixed = {
			{-0.0625, -0.5, 0.25, 0.0625, -0.46875, 0.5}, -- NodeBox1
			{-0.09375, -0.46875, 0.25, 0.09375, -0.4375, 0.5}, -- NodeBox2
			{-0.1875, -0.4375, 0.25, 0.1875, -0.40625, 0.5}, -- NodeBox3
			{-0.28125, -0.40625, 0.25, 0.28125, -0.375, 0.5}, -- NodeBox4
			{-0.34375, -0.375, 0.25, 0.34375, -0.34375, 0.5}, -- NodeBox5
			{-0.375, -0.34375, 0.25, 0.375, -0.3125, 0.5}, -- NodeBox6
			{-0.40625, -0.3125, 0.25, 0.40625, -0.28125, 0.5}, -- NodeBox7
			{-0.40625, -0.28125, 0.25, 0.40625, -0.25, 0.5}, -- NodeBox8
			{-0.4375, -0.25, 0.25, 0.4375, -0.21875, 0.5}, -- NodeBox9
			{-0.4375, -0.21875, 0.25, 0.4375, -0.1875, 0.5}, -- NodeBox10
			{-0.46875, -0.1875, 0.25, 0.46875, -0.15625, 0.5}, -- NodeBox11
			{-0.46875, -0.15625, 0.25, 0.46875, -0.125, 0.5}, -- NodeBox12
			{-0.46875, -0.125, 0.25, 0.46875, -0.09375, 0.5}, -- NodeBox13
			{-0.5, -0.09375, 0.25, 0.5, -0.0625, 0.5}, -- NodeBox14
			{-0.5, -0.0625, 0.25, 0.5, 0.5, 0.5}, -- NodeBox15
		}
	},
	selection_box = {
			type = "fixed",
			fixed = {
				{-0.500000,-0.500000,0.25000,0.500000,0.500000,0.500000},
			},
		},
})

minetest.register_craft({
	output = "coats_of_arms:two_color_vertical_neutral",
	recipe = {
		{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
		{""                   , "default:steel_ingot", ""},
		{"","dye:white",""}

	}
})

unifieddyes.register_color_craft({
    output = "coats_of_arms:two_color_vertical",
    palette = "extended",
    type = "shapeless",
    neutral_node = "coats_of_arms:two_color_vertical_neutral",
    recipe = {"NEUTRAL_NODE", "MAIN_DYE"},
})
CFS - still widely unknown

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by VanessaE » Post

By "static" I mean "doesn't change" i.e. not re-colored by param2.

Inventory images are a tricky thing - there's a helper function to create one that's at least close, but even then Minetest doesn't get it right.

You're still going to have an issue with rotations though. A node of that shape surely will need some kind of rotation ability, but Minetest will only give you 8 colors in regular facedir mode. It's an engine limitation - poor decision by the core devs. Unified Dyes does not support 8-color mode (because I figured you may as well just bake the colors in at that point), so you'll either need to use the "split" palette mode, which has 190-some colors, or colorwallmounted mode, which has 32.

For practical examples of how those work, see my coloredwood mod and the tapestries in the castle modpack, respectively.

Also I suggest using a proper mesh node, rather than nodeboxes.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Nordal » Post

Thank you for your further explanations!
By "static" I mean "doesn't change" i.e. not re-colored by param2.
But then, is it possible at all, to change two colors on the front of that coat of arm node? My goal is that one clicks with the airbrush at the right half and color it the color one likes, then clicks at the left half and color it any other color. But I still have no idea how to get there. Would you help me to achieve that?

My further plan is, to provide diagonal divided fronts or horizontal divided ones. And one or two additional nodes that vary in shape.

Thanks to your explanations I think I now understood how to color only the front of a node with one color. And I'm aware now, that I need some rotation for a node of my kind, but rotation is done with paramtype2, so there's a conflict, 'cause unifieddyes uses paramtype2 for colorizing. That's why I must use the "split" palette mode (because I would like to have more than 32 colors). But I think I really understood only the tapestries example so far which has 32 colors.
Also I suggest using a proper mesh node, rather than nodeboxes.
I have even less than no idea how to get mesh node, texture and colors together. I tried two years ago with blender, but failed pitifully. If mesh nodes simplified anything, I'd be open for that. May I can convert the nodeboxes with rubenwardy's nodeboxeditor. I made the current shape with it.
CFS - still widely unknown

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by VanessaE » Post

But then, is it possible at all, to change two colors [...]
Not with hardware coloring alone. Only one hardware-applied color is possible.

There are two general ways it can be done though, if you "fake" it:

A. do hardware coloring on one side, and baked-in color on the other side. You would need as many nodes with baked-in color as there are colors you wish to support on that side, which kinda defeats the point of hardware coloring. :-)

B. there are a couple of "painting" mods out there that use texture compositing onto entities (this technique is what gave rise to the original signs mod that grew into signs_lib and friends).

Both of those are way out-of-scope for Unified Dyes. :-P
'cause unifieddyes uses paramtype2 for colorizing. That's why I must use the "split" palette mode (because I would like to have more than 32 colors). But I think I really understood only the tapestries example so far which has 32 colors.
No, it's the engine that uses param2/paramtype2 for that. Unified Dyes just provides the colors and framework for using them in other mods. That aside, you seem to have the right idea. :-)
I have even less than no idea how to get mesh node, texture and colors together
Each material in your mesh will be assigned textures from the tiles and overlay_tiles entries in your node def, in the order the materials appear in the model file (one of each, per material). Otherwise, they're handled exactly the same as any other node type, and compared to nodebox-based shapes, they're much easier to manage, and can be made to use fewer polygons, too, which is good for performance in the long run.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Nordal » Post

Thank you for helping.
Both of those are way out-of-scope for Unified Dyes. :-P
:) That means I have to do solution A. or B. which exclude unifieddyes. Alright.

Solution A:
So I have to do hardware coloring on the one hand. This is done by using tiles and restricted to the front by

Code: Select all

{name = tile_side, color = "white"}
for all the other tiles except the front tile. What texture do I have to give to the front tile? The, let's say left half side, shaped, texture of the node's front shape? In which color?
Or could you give an example, please?

On the other hand I have to do is "baked_in" color. Do you mean software overlay with that? And that is done with the overlay_tiles, using the similar trick of restricting colorizing to the front tile by setting an empty image ("coats_of_arms_empty_image.png") to all the other overlay_tiles. But how to create the right side's front texture. Is

Code: Select all

{ name = "coats_of_arms_static_overlay.png", color = "white" }
still right for the front overlay_tile? If not, could you give an example here, too, please?
You would need as many nodes with baked-in color as there are colors you wish to support on that side, which kinda defeats the point of hardware coloring. :-)
I don't fully understand this. I suppose I have to loop through the colors I wish to be craftable at the end and in the loop I have to register one node for each color.
defeats the point of hardware coloring.

I'm sorry,I don't understand. Must be something funny. What do you mean?

I would like to be sure I understand the things above right before I go on with the process of finding a solution. So I please you to answer first.
CFS - still widely unknown

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by VanessaE » Post

What texture do I have to give to the front tile? The, let's say left half side, shaped, texture of the node's front shape? In which color?
That's entirely up to you.
On the other hand I have to do is "baked_in" color. Do you mean software overlay with that?
No, this phrase means you put the colors into the texture, like the way colorization used to be done in Minetest (or if you like, the way it's done in minetest_game's wool mod)

Code: Select all

{ name = "coats_of_arms_static_overlay.png", color = "white" }
still right for the front overlay_tile?
If you want the overlay to not respond to param2 coloring. Normally that's how it's done.
defeats the point of hardware coloring.
I'm sorry,I don't understand. Must be something funny. What do you mean?
I mean the point of using hardware coloring is so that you don't have to create lots of nodes with the colors baked-in -- you'd normally just create one node, then change its color afterward. But if you want to have something with two changeable colors, you have no choice but to do it the old way.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Nordal » Post

Well, thanks a lot, Vanessa!
With a backpack full of informations I'll take a creative time out and then start to write this mod the "standard way".
CFS - still widely unknown

User avatar
AlexYst
Member
Posts: 109
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst
Contact:

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by AlexYst » Post

I was working with palettes today for one of my own mods, and I set the palette metadata of my items as I usually do. I noticed though that my white ones that I hadn't placed into the world weren't stacking like they should with the same nodes that had been placed and dug back up, so I took a look at the stack strings and found index zero items no longer store palette metadata when dug. Seeing that made me think of Unified Dyes. Because I know it doesn't use index zero for white and instead uses code to shift unindexed nodes to index 240, I was curious as to how you dealt with the new behaviour figuring I could learn something, so I tested out Unified Dyes again to see how it works now. I see that you did see and account for the change in the engine, but I ended up finding a bug too.

First, items crafted using faint red dye (index zero) get converted to no-metadata (white) items upon crafting. Effectively, white dye and faint red dye both act like white dye when crafting, so there's no way to craft faint red items. Second, while faint red dye can be used with the airbrush on in-world nodes to create faint red (index zero) nodes, those nodes become white (no metadata) items when dug and stay white (index 240) when placed into the world. Basically, faint red items cannot exist in-world without the airbrush, and if mined, they mysteriously (mysteriously to the player, anyway) turn white.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by VanessaE » Post

This is actually an engine fault/regression (https://github.com/minetest/minetest/issues/10687), but I've put some workarounds into place to deal with it. Craft, place, and dig all seem to work properly now. Tested with white, faint pink, and other colors.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
xianjiro
Member
Posts: 25
Joined: Thu Aug 31, 2017 05:49
Location: West Coast North America
Contact:

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by xianjiro » Post

]I have installed Unified Dyes and am running Minetest 5.5.1 on a Win 10 box. I tried to make violet dye by crafting one red dye with one blue dye as per the crafting guide:
Screenshot 2022-09-11 014905.png[/attachment However, every combination I tried results in magenta dye, not violet. [attachment=1]Screenshot 2022-09-11 014955.png
Attachments
Screenshot 2022-09-11 014905.png
Screenshot 2022-09-11 014905.png (41.97 KiB) Viewed 1653 times
Screenshot 2022-09-11 014955.png
Screenshot 2022-09-11 014955.png (25.17 KiB) Viewed 1653 times

Hupfi1
Member
Posts: 33
Joined: Sat Jun 18, 2016 15:47
GitHub: Hupfi1
IRC: Hupfi1
In-game: Hupfi

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Hupfi1 » Post

Hi, i got a problem with this mod: i just updated my minetest to version 5.6.1. But now in my inventory the textures of the clay blocks are missing.
Image
Can you help me?

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: [Mod] Unified Dyes [20170620][unifieddyes]

by Festus1965 » Post

Hupfi1 wrote:
Mon Mar 27, 2023 16:05
Hi, i got a problem with this mod: i just updated my minetest to version 5.6.1. But now in my inventory the textures of the clay blocks are missing.
I upgraded beginning of March from 5.5.0 to 5.6.1 but did NOT change or update any mod as of that,
and I just check, my baked clay nodes are shown.

I (still) use bakedclay : 8cd2d3d from 01.04.2019 - as not problems
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 24 guests