how do i add an overlay to an inventory-texture?

User avatar
Drachenbauer32
Member
 
Posts: 35
Joined: Wed Aug 28, 2019 18:11

how do i add an overlay to an inventory-texture?

by Drachenbauer32 » Tue Sep 03, 2019 19:31

Hello

How do i put an overlay-texture on an inventory- and wield-texture?
Only the basic texture should be affected by "color = <value form list>".
the overlay should keep it´s original colors.
 

User avatar
TumeniNodes
Member
 
Posts: 2801
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: how do i add an overlay to an inventory-texture?

by TumeniNodes » Tue Sep 03, 2019 19:54

look at how this is done with fences in default.
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

User avatar
DS-minetest
Member
 
Posts: 1109
Joined: Thu Jun 19, 2014 19:49
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.
GitHub: DS-Minetest
In-game: DS

Re: how do i add an overlay to an inventory-texture?

by DS-minetest » Tue Sep 03, 2019 20:27

I'm not quite sure what you are referring to with "color = <value form list>". There are color palettes but there's no color list.
And I don't really think that fences do what you want. This sounds like if you want to set inventory and wield overlays.
Some useful links:
The PR that added inventory and wield overlays: https://github.com/minetest/minetest/pull/6107
Lua api: https://github.com/minetest/minetest/bl ... i.txt#L735
Also nodedef: https://github.com/minetest/minetest/bl ... 6163-L6168
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

ShadMOrdre
Member
 
Posts: 470
Joined: Mon Dec 29, 2014 08:07
Location: USA
GitHub: ShadMOrdre
In-game: shadmordre

Re: how do i add an overlay to an inventory-texture?

by ShadMOrdre » Tue Sep 03, 2019 22:48

You can simply apply the colorize texture modifier to your texture.

tiles = "mytexturename.png^[colorize:#000000"

To colorize only a specific texture, use:

tiles = "(mytexturename.png^[colorize:#000000)^someothertexture.png"

The key is to surround the texture and modifier for that texture in parenthesis, and use the caret (^) to add further textures and modifers.

The color value used in the node def will colorize the entire node, which is why you are experiencing the behavior you do. You can also use the overlay_tile, (or whatever its called) to apply an overlay to a texture that is being colorized otherwise.

Please read the entire section of the lua_api.txt file, (found in the doc folder of your minetest installation). As others have suggested, you might also look at what other mods are doing.

I do recommend my lib_shapes mod for seeing texture modifiers in action. Specifically the furniture, and while not used in the mod, there is a file included that should show how texture modifiers were used to create lamps and other lighting options.

Shad
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.
 

User avatar
Drachenbauer32
Member
 
Posts: 35
Joined: Wed Aug 28, 2019 18:11

Re: how do i add an overlay to an inventory-texture?

by Drachenbauer32 » Wed Sep 04, 2019 14:56

DS-minetest wrote:I'm not quite sure what you are referring to with "color = <value form list>". There are color palettes but there's no color list.


It´s just a placeholder for a color-entry in a list i created my self, that i already use to give the node-model-testure a color.
Code: Select all
local dyes = {
   {"red",        "Red",        {a=255, r=255, g=  0, b=  0}},
   {"orange",     "Orange",     {a=255, r=255, g=127, b=  0}},
   {"yellow",     "Yellow",     {a=255, r=255, g=255, b=  0}},
   {"green",      "Green",      {a=255, r=  0, g=255, b=  0}},
   {"dark_green", "Dark-Green", {a=255, r=  0, g=191, b=  0}},
   {"cyan",       "Cyan",       {a=255, r=  0, g=255, b=255}},
   {"light_blue", "Light-Blue", {a=255, r=  0, g=127, b=255}},
   {"blue",       "Blue",       {a=255, r=  0, g=  0, b=255}},
   {"purple",     "Purple",     {a=255, r=159, g=  0, b=255}},
   {"magenta",    "Magenta",    {a=255, r=255, g=  0, b=255}},
   {"pink",       "Pink",       {a=255, r=255, g=173, b=183}},
   {"brown",      "Brown",      {a=255, r=159, g=127, b= 95}},
   {"white",      "White",      {a=255, r=255, g=255, b=255}},
   {"grey",       "Grey",       {a=255, r=191, g=191, b=191}},
   {"dark_grey",  "Dark-Grey",  {a=255, r=127, g=127, b=127}},
   {"black",      "Black",      {a=255, r= 95, g= 95, b= 95}}
}

for i = 1, #dyes do
    local name, desc, dye = unpack(dyes[i])

    -- Simple shaped bed

    beds.register_bed("beds:bed_" .. name, {
       description = "Simple " ..desc .. " Bed",
   color = dye,



ShadMOrdre wrote:You can simply apply the colorize texture modifier to your texture.

tiles = "mytexturename.png^[colorize:#000000"

To colorize only a specific texture, use:

tiles = "(mytexturename.png^[colorize:#000000)^someothertexture.png"

The key is to surround the texture and modifier for that texture in parenthesis, and use the caret (^) to add further textures and modifers.

The color value used in the node def will colorize the entire node, which is why you are experiencing the behavior you do. You can also use the overlay_tile, (or whatever its called) to apply an overlay to a texture that is being colorized otherwise.

Please read the entire section of the lua_api.txt file, (found in the doc folder of your minetest installation). As others have suggested, you might also look at what other mods are doing.

I do recommend my lib_shapes mod for seeing texture modifiers in action. Specifically the furniture, and while not used in the mod, there is a file included that should show how texture modifiers were used to create lamps and other lighting options.

Shad


You talk about the tiles for the look as a node, but i mean the inventory and wield images.
And "colorize:#000000" makes an other look, than "color = a color".
In the color-blocks-game i see, that "colorize" it colores white textures to a pastellic look, and if i make alpha max, it shows simply the choosen color and not more the thexture, that should be colored in.
the variant in my code ontop makes pretty bright colored textures, if alpha from the color is max.
If no item texture is set, the inventory shows a right colored little preview of the node.
But my beds have an extre item-texture.

What i want to know is, how do i add
Code: Select all
{ name = "beds_bed_item_overlay.png", color = "white" }

to
Code: Select all
inventory_image = "beds_bed_item.png",

?

The inventory image-part is already colored by
Code: Select all
color = dye,

, that´s also shown in the bigger piece of code on top of the post.

Edid:
now i found the solution:
Code: Select all
inventory_image = "beds_bed_item.png",
wield_image = "beds_bed_item.png",
inventory_overlay = "beds_bed_item_overlay.png",
wield_overlay = "beds_bed_item_overlay.png",

I found out, that i don´t have to set white coloring in theese overlays.
 

User avatar
Drachenbauer32
Member
 
Posts: 35
Joined: Wed Aug 28, 2019 18:11

Re: how do i add an overlay to an inventory-texture?

by Drachenbauer32 » Wed Sep 04, 2019 15:49

Another question:

i made glass-doors with colored frames (added my color list inside the lua-file of the doors-mod and worked out the glass-door-part to work with it.).
But i noticed, that they stay white on the item-texture (the placed door in ly house looks correct colored).

How do i apply the color to the item-picture in this code-type?
 

User avatar
TumeniNodes
Member
 
Posts: 2801
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: how do i add an overlay to an inventory-texture?

by TumeniNodes » Wed Sep 04, 2019 18:09

you need to make a new item texture to use for inventory and wield
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

User avatar
Drachenbauer32
Member
 
Posts: 35
Joined: Wed Aug 28, 2019 18:11

Re: how do i add an overlay to an inventory-texture?

by Drachenbauer32 » Wed Sep 04, 2019 18:22

there is an item-texture, but the color value, i used to color it in, does not affect the item-texture.
I made a list of color values and applyed them with "color = a color from the list" to the node.of the existing glass door.
It makes the placed door look right colored, but itßs item-texture-stays white.

Look in the mod "doors" in "minetest game" i just don´t know why the color does not affect the item texture of the glass-door.
 

User avatar
TumeniNodes
Member
 
Posts: 2801
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: how do i add an overlay to an inventory-texture?

by TumeniNodes » Wed Sep 04, 2019 19:00

You really need to start trying to give more info... your questions are a bit too vague.
Use pastebin or similar and post the code you've changed please, otherwise you are making it difficult for people to help you.

"Help us, help you"
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

ShadMOrdre
Member
 
Posts: 470
Joined: Mon Dec 29, 2014 08:07
Location: USA
GitHub: ShadMOrdre
In-game: shadmordre

Re: how do i add an overlay to an inventory-texture?

by ShadMOrdre » Thu Sep 05, 2019 06:56

in the node def

.inventoryimage = "yourtexturehere.png^[colorize:" .. colorvalue *(colorvalue is an RGBA or Colorstring value.)

Open, look at, and read lua_api.txt. It's all there.

Try to explain more than what you want, show code for what you are doing so we can see how to help. Each question should have relevant code sample for any real assistance.


Shad
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 3 guests