Page 1 of 1

is there any way to use a color-value instead of textures?

PostPosted: Wed Aug 28, 2019 19:03
by Drachenbauer32
Hello

I have mods with multicolored nodes/items (beds, wool, concrete, butterflies, dye; just modifyed copies of existing mods).
Actually they use different textures for each color.
Is there a way to use only white textures and add color-values, wich generate the actual colors ingame?.

Re: is there any way to use a color-vanue instead of texture

PostPosted: Wed Aug 28, 2019 21:56
by TumeniNodes
from here and below you should find what you're looking for
https://rubenwardy.com/minetest_modding ... colorratio

Re: is there any way to use a color-vanue instead of texture

PostPosted: Fri Aug 30, 2019 20:22
by Drachenbauer32
the beds are a bit more tricky:
they have a wooden frame (should keep original color) and a fabric matress (should be dyable).
How can i manage this?

All other dyable stuff works now.

Re: is there any way to use a color-vanue instead of texture

PostPosted: Sat Aug 31, 2019 14:39
by AiTechEye
1: https://gitlab.com/VanessaE/ilights/blo ... a#L178-184

2: maybe cuz those param2 is set as 0 while constructed
try something like:
Code: Select all
on_construct=function(pos)
   if minetest.get_node(pos).param2 ~= 2 then
       minetest.swap_node(pos,{name="name",param2=2})
   end
end

Re: is there any way to use a color-vanue instead of texture

PostPosted: Sat Aug 31, 2019 20:49
by Drachenbauer32
i made them with a color-string in the list instead of a palette now.
that works (butterflies, concrete, dye and wool are ok now).

But my beds stay white, if i do the same with them.
how can i dye only the fabric mattress, but not the wooden frame of the beds?

Re: is there any way to use a color-vanue instead of texture

PostPosted: Sun Sep 01, 2019 00:03
by TumeniNodes
Drachenbauer32 wrote:But my beds stay white, if i do the same with them.
how can i dye only the fabric mattress, but not the wooden frame of the beds?


viewtopic.php?f=9&t=18910

Re: is there any way to use a color-vanue instead of texture

PostPosted: Sun Sep 01, 2019 03:23
by ShadMOrdre
There are some texture modifiers that might help.

You can colorize the texture, and provide an overlay texture that does not get colorized, IIRK.

Re: is there any way to use a color-vanue instead of texture

PostPosted: Sun Sep 01, 2019 10:43
by Drachenbauer32
i noticed, if a node-type is not registered with:
Code: Select all
minetest.register_node("blockname", {
})

coloring may not work properly.

for sample beds are registered with
Code: Select all
beds.register_bed("beds:bed_" .. name, {
})

and stay white.

Re: is there any way to use a color-vanue instead of texture

PostPosted: Sun Sep 01, 2019 12:24
by Drachenbauer32
now with the help of the linked mod, i found a way to color in the beds right.

With
Code: Select all
overlay_tiles = {
}

i used a set of textures, wich content only the wood-parts, and i was able to use color = "white" inside theese lines to keep them save from changing their color

Is there a way to use an overlay for their item-pictures too?
How do i overlay a testure with color = "white" on the item-testure?

Re: is there any way to use a color-vanue instead of texture

PostPosted: Sun Sep 01, 2019 17:03
by Drachenbauer32
after a bit searching i found this:
https://github.com/minetest/minetest/pull/6107
with a link to this:
https://github.com/osjc/minetest/commit/4670b170d1bf124a2b94a5b1ddd5e5c793cfa4e3#diff-598e9ded205c524fa4804d7869c9c4cd

But how can i add it to my minetest to make it work (there is something about android, but my one is for windows)?

Re: is there any way to use a color-vanue instead of texture

PostPosted: Sat Sep 28, 2019 19:34
by Drachenbauer32
ok, that´s already in the code.

How can i color particles this style?
And the emitted light from nodes?