CLtheman1 wrote: ↑Tue Mar 15, 2022 14:35
The metal blocks and steel override in this mod still use the old MT metal block style. How were Technic's metal blocks recolored? I'd like to use color filters to update those textures to the current MT metal textures, using the default steel block as a base. Please tell me the hex code to put in a color filter for each block.
They were probably done in a graphics editor like GIMP, given they all use unique textures based on the older metal block style. This does give a bit better control over the output like adjusting brightness curves/levels or using one of many blending modes. Still,
Here's a patch to get you started:
Code: Select all
---
technic/items.lua | 2 +-
technic_worldgen/nodes.lua | 33 +++++++--------------------------
2 files changed, 8 insertions(+), 27 deletions(-)
diff --git a/technic/items.lua b/technic/items.lua
index d1565d7..45f6475 100644
--- a/technic/items.lua
+++ b/technic/items.lua
@@ -184,7 +184,7 @@ for p = 0, 35 do
local radioactivity = math.floor(math.sqrt((1+5.55*p/35) * 18 / (1+5.55*7/35)) + 0.5);
(ov or minetest.register_node)(block, {
description = string.format(S("%.1f%%-Fissile Uranium Block"), p/10),
- tiles = {"technic_uranium_block.png"},
+ tiles = { "default_steel_block.png^[colorize:#00EE0055" },
is_ground_content = true,
groups = {uranium_block=1, not_in_creative_inventory=nici,
cracky=1, level=2, radioactive=radioactivity},
diff --git a/technic_worldgen/nodes.lua b/technic_worldgen/nodes.lua
index d4d3e4c..c07d518 100644
--- a/technic_worldgen/nodes.lua
+++ b/technic_worldgen/nodes.lua
@@ -72,7 +72,7 @@ minetest.register_node( ":technic:marble_bricks", {
minetest.register_node(":technic:uranium_block", {
description = S("Uranium Block"),
- tiles = { "technic_uranium_block.png" },
+ tiles = { "default_steel_block.png^[colorize:#00EE0055" },
is_ground_content = true,
groups = {uranium_block=1, cracky=1, level=2, radioactive=2},
sounds = default.node_sound_stone_defaults()
@@ -80,7 +80,7 @@ minetest.register_node(":technic:uranium_block", {
minetest.register_node(":technic:chromium_block", {
description = S("Chromium Block"),
- tiles = { "technic_chromium_block.png" },
+ tiles = { "default_steel_block.png^[colorize:#EEEEFF55" },
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
@@ -88,7 +88,7 @@ minetest.register_node(":technic:chromium_block", {
minetest.register_node(":technic:zinc_block", {
description = S("Zinc Block"),
- tiles = { "technic_zinc_block.png" },
+ tiles = { "default_steel_block.png^[colorize:#00AAFF55" },
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
@@ -106,12 +106,12 @@ minetest.register_alias("technic:wrought_iron_block", "default:steelblock")
minetest.override_item("default:steelblock", {
description = S("Wrought Iron Block"),
- tiles = { "technic_wrought_iron_block.png" },
+ tiles = { "default_steel_block.png" },
})
minetest.register_node(":technic:cast_iron_block", {
description = S("Cast Iron Block"),
- tiles = { "technic_cast_iron_block.png" },
+ tiles = { "default_steel_block.png^[colorize:#4466BB55" },
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
@@ -119,7 +119,7 @@ minetest.register_node(":technic:cast_iron_block", {
minetest.register_node(":technic:carbon_steel_block", {
description = S("Carbon Steel Block"),
- tiles = { "technic_carbon_steel_block.png" },
+ tiles = { "default_steel_block.png^[colorize:#33559955" },
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
@@ -127,7 +127,7 @@ minetest.register_node(":technic:carbon_steel_block", {
minetest.register_node(":technic:stainless_steel_block", {
description = S("Stainless Steel Block"),
- tiles = { "technic_stainless_steel_block.png" },
+ tiles = { "default_steel_block.png^[colorize:#EEEEEE55" },
is_ground_content = true,
groups = {cracky=1, level=2},
sounds = default.node_sound_stone_defaults()
@@ -165,24 +165,5 @@ for_each_registered_node(function(node_name, node_def)
})
end
local tiles = node_def.tiles or node_def.tile_images
- if tiles then
- local new_tiles = {}
- local do_override = false
- if type(tiles) == "string" then
- tiles = {tiles}
- end
- for i, t in ipairs(tiles) do
- if type(t) == "string" and t == "default_steel_block.png" then
- do_override = true
- t = "technic_wrought_iron_block.png"
- end
- table.insert(new_tiles, t)
- end
- if do_override then
- minetest.override_item(node_name, {
- tiles = new_tiles
- })
- end
- end
end)
--
2.35.1
Make sure you have cloned technic through git, then simply copy that into a file in your technic directory and run
git apply <filename> (or copy the marked differences manually if that's too hard for you). The colours are a bit off, but if you're familiar with hexadecimal colour strings you'll get there eventually by tweaking them. That's the hard part from my perspective :P I recommend keeping two Minetest windows open side-by-side: one with the current textures, the other you keep reloading with the new recolours.
For your further reference: