[Mod] add colored plaster coats to nodes [plasterwork]

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

[Mod] add colored plaster coats to nodes [plasterwork]

by Sokomine » Fri Jan 26, 2018 21:01

Image

This mod adds only four lightweight new nodes: One machine and three blocks that can be covered with colored plaster. The textures for the plaster are those of clay, coral and tin block from default. The colors come from VanessaEs unifieddyes palette (unifieddyes is not required).

Usage: Craft the machine and place it on top of the block that carries the desired plaster. Right-click the machine. Insert at least one mese crystal fragment. Click on the "Scan .." button. The machine needs the mese crystal fragment to scan the block below and analyze the plaster. The block below needs to stay there as long as you want to use the machine.
Image

The machine is now ready for use. Insert the cobble. The machine will break it down, search for the right trace minerals and apply the coating to the remaining blocks. Click on "Start coating".
Image

And the machine is done. No need to wait for it like with a furnace. You can take out the new nodes and convert many more. However, once you want to switch to a new coating. you have to exchange the block below the machine and pay a new mese crystal fragment for the new scan.
Image

You might wonder how to actually get any plastered nodes to start with. They usually do not spawn (unless you use the upcoming simple_houses mod) and there is no way to craft them. The colormachine can't really handle it either - 256 colors are just too much. So...what to do? Luckily, copper blocks proved to be very reaction-friendly. It was found out that placing the macine on a copper block and initiating a scan turned the copper block into one with random coating and color!
Image

Craft receipe for the machine:
Image

Setting it up and getting the desired blocks is admittedly a bit expensive. On the other hand having all colors at once would be overwhelming. Using more than perhaps 2-4 major diffrent block types on a project usually does not look that good either. So...hope for nice coats and colors and try to create something decorative with what you'll get :-)

Special thanks to the_raven_262 for creating model and textures for the machine! And thanks to VanessaE for the unifieedyes palette.

Download: https://github.com/Sokomine/plasterwork ... master.zip
Browse code: https://github.com/Sokomine/plasterwork
Version: 1.0
Licence: GPLv3
Depends on: default
Attachments
plasterwork_random.jpg
(18 KiB) Not downloaded yet
plasterwork_craft.jpg
(19.36 KiB) Not downloaded yet
plasterwork_overview.jpg
(108.3 KiB) Not downloaded yet
Last edited by Sokomine on Sat Jan 27, 2018 20:59, edited 1 time in total.
A list of my mods can be found here.
 

User avatar
cx384
Member
 
Posts: 492
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: add colored plaster coats to nodes [plasterwork]

by cx384 » Sat Jan 27, 2018 10:30

Error:
Code: Select all
WARNING[Main]: Undeclared global variable "default" accessed at .../.minetest/mods/plasterwork/nodes.lua:14
ERROR[Main]: ModError: Failed to load and run script from .../.minetest/mods/plasterwork/init.lua:
ERROR[Main]: .../.minetest/mods/plasterwork/nodes.lua:14: attempt to index global 'default' (a nil value)
ERROR[Main]: stack traceback:
ERROR[Main]:    .../.minetest/mods/plasterwork/nodes.lua:14: in function 'register_plaster_node'
ERROR[Main]:    .../.minetest/mods/plasterwork/nodes.lua:25: in main chunk
ERROR[Main]:    [C]: in function 'dofile'
ERROR[Main]:    .../.minetest/mods/plasterwork/init.lua:26: in main chunk
ERROR[Main]: Siehe debug.txt für Details.

The depends.txt is missing.
Pull request.

Nice mod! Now I can turn my cobble into beautiful nodes. It is really handy, but in my opinion the randomness is too high. It would be better if you get "plasterwork:tin_plaster" from any metal block, "plasterwork:smooth_plaster" from stone (or coral) and "plasterwork:rough_plaster" from clay instead of copper blocks for everything. Oh and listring support would be nice. Moreover, the "Take:" label should be higher.

+ screenshot
Last edited by cx384 on Sat Jan 27, 2018 23:29, edited 2 times in total.
Can your read this?
 

User avatar
the_raven_262
Member
 
Posts: 315
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: the_raven_262 Raven262 Corvus262 corvus
In-game: the_raven_262 Raven262 Nevermore

Re: add colored plaster coats to nodes [plasterwork]

by the_raven_262 » Sat Jan 27, 2018 12:33

I get this error when trying to "scan" the node.
After the game crashes, the node below the machine IS replaced, but the machine is not aware of it.
Code: Select all
2018-01-27 13:16:06: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'plasterwork' in callback node_on_receive_fields(): /home/corvus/.minetest/mods/plasterwork/machine.lua:76: attempt to call field 'itemstring_with_palette' (a nil value)
2018-01-27 13:16:06: ERROR[Main]: stack traceback:
2018-01-27 13:16:06: ERROR[Main]:    /home/corvus/.minetest/mods/plasterwork/machine.lua:76: in function 'update_formspec'
2018-01-27 13:16:06: ERROR[Main]:    /home/corvus/.minetest/mods/plasterwork/machine.lua:94: in function </home/corvus/.minetest/mods/plasterwork/machine.lua:84>
[amber] [conjuration] [warzone] | Why is #minetest-mod-dev so empty?
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: add colored plaster coats to nodes [plasterwork]

by Sokomine » Sat Jan 27, 2018 19:16

cx384 wrote:The depends.txt is missing.
Pull request.

Thanks. Merged. Forgot that one.

cx384 wrote:but in my opinion the randomness is to high. It would be better if you get "plasterwork:tin_plaster" from any metal block, "plasterwork:smooth_plaster" from stone (or coral) and "plasterwork:rough_plaster" from clay instead of copper blocks for everything.

The too high randomness has been bothering me as well. Your idea of using diffrent source nodes sounds good. It would even be logical to take the nodes the texture is taken from. And yet...clay would be a bit too cheap, while coral is too rare. I've settled for the following now: Steel block for smooth, tin block for metallic, copper block for clay, bronze block remains for random, and gold block (that one was left over) for a new sandstone version. The sandstone texture works very well when colored.
Image

cx384 wrote: Oh and listring support would be nice. Moreover, the "Take:" label should be higher.

I never could get the hang of listrings. Perhaps they're good for something. Most of the time the strange/unexpected behaviour of those listrings just confuses me. Would be hard to test if the desired result is unkown.
As to the take label...i'm afraid that's formspecs. It looks very fine for me, but then my font size is pretty large compared to the default. Or do you mean the output field as such?

the_raven_262 wrote:I get this error when trying to "scan" the node.
After the game crashes, the node below the machine IS replaced, but the machine is not aware of it.

You need a newer version of MT. Yours does not seem to support the function that adds the colors to inventory items yet. The machine won't be able to work without.
Attachments
plasterwork_sources.jpg
(61.46 KiB) Not downloaded yet
A list of my mods can be found here.
 

User avatar
RSLRedstonier
Member
 
Posts: 449
Joined: Wed May 10, 2017 21:00
Location: some were in middle earth
GitHub: RSL-Redstonier
In-game: RSLRedstonier

Re: add colored plaster coats to nodes [plasterwork]

by RSLRedstonier » Sat Jan 27, 2018 20:36

I created something similar a while back that used node texture modifier and registered something like:
dyable blocks:
base block (432) colors
steel blocks (216) colors
stone blocks (432) colors
stone bricks (432) colors
cobble (216) colors
and any dyed variant of the ones above can be re dyed back to normal

chiselable blocks:

base block
dirt
stone
cobble
wheat seeds
"A programmer is just a tool which converts caffeine into code"

try out my skytest mod always being updated!
https://forum.minetest.net/viewtopic.php?f=9&t=17568
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] add colored plaster coats to nodes [plasterwork]

by Sokomine » Sat Jan 27, 2018 21:00

RSLRedstonier wrote:I created something similar a while back that used node texture modifier and registered something like:

Feel free to link your mod here. I'm a bit puzzled about the amount of colors. Hardware coloring only supports 256 colors per node.
A list of my mods can be found here.
 

User avatar
RSLRedstonier
Member
 
Posts: 449
Joined: Wed May 10, 2017 21:00
Location: some were in middle earth
GitHub: RSL-Redstonier
In-game: RSLRedstonier

Re: [Mod] add colored plaster coats to nodes [plasterwork]

by RSLRedstonier » Sat Jan 27, 2018 21:39

I haven't released my mod yet but it uses 216 hex codes
here is the code segment for just the coloring nodes

Code: Select all
local HEXCODES = {
"FFFFFF",
"CCCCCC",
"999999",
"666666",
"333333",
"000000",
"FFCC00",
"FF9900",
"FF6600",
"FF3300",
"99CC00",
"CC9900",
"FFCC33",
"FFCC66",
"FF9966",
"FF6633",
"CC3300",
"CC0033",
"CCFF00",
"CCFF33",
"333300",
"666600",
"999900",
"CCCC00",
"FFFF00",
"CC9933",
"CC6633",
"330000",
"660000",
"990000",
"CC0000",
"FF0000",
"FF3366",
"FF0033",
"99FF00",
"CCFF66",
"99CC33",
"666633",
"999933",
"CCCC33",
"FFFF33",
"996600",
"993300",
"663333",
"993333",
"CC3333",
"FF3333",
"CC3366",
"FF6699",
"FF0066",
"66FF00",
"99FF66",
"66CC33",
"669900",
"999966",
"CCCC66",
"FFFF66",
"996633",
"663300",
"996666",
"CC6666",
"FF6666",
"990033",
"CC3399",
"FF66CC",
"FF0099",
"33FF00",
"66FF33",
"339900",
"66CC00",
"99FF33",
"CCCC99",
"FFFF99",
"CC9966",
"CC6600",
"CC9999",
"FF9999",
"FF3399",
"CC0066",
"990066",
"FF33CC",
"FF00CC",
"00CC00",
"33CC00",
"336600",
"669933",
"99CC66",
"CCFF99",
"FFFFCC",
"FFCC99",
"FF9933",
"FFCCCC",
"FF99CC",
"CC6699",
"993366",
"660033",
"CC0099",
"330033",
"33CC33",
"66CC66",
"00FF00",
"33FF33",
"66FF66",
"99FF99",
"CCFFCC",
"CC99CC",
"996699",
"993399",
"990099",
"663366",
"660066",
"006600",
"336633",
"009900",
"339933",
"669966",
"99CC99",
"FFCCFF",
"FF99FF",
"FF66FF",
"FF33FF",
"FF00FF",
"CC66CC",
"CC33CC",
"003300",
"00CC33",
"006633",
"339966",
"66CC99",
"99FFCC",
"CCFFFF",
"3399FF",
"99CCFF",
"CCCCFF",
"CC99FF",
"9966CC",
"663399",
"330066",
"9900CC",
"CC00CC",
"00FF33",
"33FF66",
"009933",
"00CC66",
"33FF99",
"99FFFF",
"99CCCC",
"0066CC",
"6699CC",
"9999FF",
"9999CC",
"9933FF",
"6600CC",
"660099",
"CC33FF",
"CC00FF",
"00FF66",
"66FF99",
"33CC66",
"009966",
"66FFFF",
"66CCCC",
"669999",
"003366",
"336699",
"6666FF",
"6666CC",
"666699",
"330099",
"9933CC",
"CC66FF",
"9900FF",
"00FF99",
"66FFCC",
"33CC99",
"33FFFF",
"33CCCC",
"339999",
"336666",
"006699",
"003399",
"3333FF",
"3333CC",
"333399",
"333366",
"6633CC",
"9966FF",
"6600FF",
"00FFCC",
"33FFCC",
"00FFFF",
"00CCCC",
"009999",
"006666",
"003333",
"3399CC",
"3366CC",
"0000FF",
"0000CC",
"000099",
"000066",
"000033",
"6633FF",
"3300FF",
"00CC99",
"0099CC",
"33CCFF",
"66CCFF",
"6699FF",
"3366FF",
"0033CC",
"3300CC",
"00CCFF",
"0099FF",
"0066FF",
"0033FF",
}

minetest.register_node("ntm_extension:base_color",{
description = "Base Block\ncan be dyed and chiseled in a ntm block thing",
tiles = {"ntm_extension_color.png"},
groups = {cracky = 3},
})
minetest.register_craft({
    output = "ntm_extension:base_color 32",
    recipe = {
            {"default:paper","default:paper","default:paper"},
            {"default:paper","node_texture_modifier:dye_mixture","default:paper"},
            {"default:paper","default:paper","default:paper"}
        }
})
minetest.register_craft({
    output = "ntm_extension:base_color 8",
    recipe = {
            {"group:leaves","group:leaves","group:leaves"},
            {"group:leaves","group:dye","group:leaves"},
            {"group:leaves","group:leaves","group:leaves"},
        }
})
minetest.register_craft({
    output = "ntm_extension:base_color 16",
    recipe = {
            {"group:leaves","group:leaves","group:leaves"},
            {"group:leaves","node_texture_modifier:dye_mixture","group:leaves"},
            {"group:leaves","group:leaves","group:leaves"},
        }
})

node_texture_modifier.add_dyed_node_too_type("ntm_extension:base_color", "color")
node_texture_modifier.add_dyed_node_too_type("default:steelblock", "steelblock")
node_texture_modifier.add_dyed_node_too_type("default:stone", "stone")
node_texture_modifier.add_dyed_node_too_type("default:stone_brick", "stone_brick")
node_texture_modifier.add_dyed_node_too_type("default:cobble", "cobble")
for number = 1, 216 do
local hex = HEXCODES[number]
--Register Stone
minetest.register_node("ntm_extension:"..hex.."_stone", {
description = hex.." Stone",
tiles = {"ntm_extension_stone.png^[colorize:#"..hex..":120"},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults()
})
--Register Stone Brick
minetest.register_node("ntm_extension:"..hex.."_stone_brick", {
description = hex.." Stone Brick",
tiles = {"ntm_extension_stone_brick.png^[colorize:#"..hex..":120"},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults()
})
--Register Steel Block
minetest.register_node("ntm_extension:"..hex.."_steel_block",{
description = hex.." Steel Block",
tiles = {"ntm_extension_steel_block.png^[colorize:#"..hex..":120"},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults()
})
minetest.register_node("ntm_extension:"..hex.."_cobble",{
description = hex.." Cobble",
tiles = {"ntm_extension_cobble.png^[colorize:#"..hex..":120"},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults()
})
minetest.register_node("ntm_extension:"..hex.."_color",{
description = hex.." Color Light",
tiles = {"ntm_extension_color.png^[colorize:#"..hex..":120"},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults()
})
minetest.register_node("ntm_extension:"..hex.."_color_2",{
description = hex.." Color Dark",
tiles = {"ntm_extension_color.png^[colorize:#"..hex..":220"},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults()
})
node_texture_modifier.add_dyed_node_too_type("ntm_extension:"..hex.."_steel_block", "steelblock")
node_texture_modifier.add_dyed_node_too_type("ntm_extension:"..hex.."_cobble", "cobble")
node_texture_modifier.add_dyed_node_too_type("ntm_extension:"..hex.."_stone_brick", "stone_brick")
node_texture_modifier.add_dyed_node_too_type("ntm_extension:"..hex.."_stone", "stone")
node_texture_modifier.add_dyed_node_too_type("ntm_extension:"..hex.."_color", "color")
node_texture_modifier.add_dyed_node_too_type("ntm_extension:"..hex.."_color_2", "color")
end



all the textures this code uses are the default ones + 1 special all white texture for the color nodes
I register 2016 different colors per node I input so 216 colors of steel 216x2colors for the base plain color block because I have to variants per color 1 brighter than the other
using node texture modifier lets you have hundreds of options per node, undye them back to the original or any other variant, and lets you chose what gets dyed to what

also my bad the only block that's supposed to have more than 216 is the base color block not stone or stone bricks
"A programmer is just a tool which converts caffeine into code"

try out my skytest mod always being updated!
https://forum.minetest.net/viewtopic.php?f=9&t=17568
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] add colored plaster coats to nodes [plasterwork]

by Sokomine » Sat Jan 27, 2018 23:04

RSLRedstonier wrote:using node texture modifier lets you have hundreds of options per node, undye them back to the original or any other variant, and lets you chose what gets dyed to what

Yes, those hex codes can be used as well. Your code appears to register 216 nodes per type and then adds color to them via hex codes. That's certainly possible. My code registers only 5 nodes and adds color to them via the palette (the sandstone was too tempting, plus the gold block wanted to get used, so...5).
A list of my mods can be found here.
 

User avatar
RSLRedstonier
Member
 
Posts: 449
Joined: Wed May 10, 2017 21:00
Location: some were in middle earth
GitHub: RSL-Redstonier
In-game: RSLRedstonier

Re: [Mod] add colored plaster coats to nodes [plasterwork]

by RSLRedstonier » Sat Jan 27, 2018 23:12

so in your code each color per node isn't a separate node?
so the red steelblock and the green steel block(just examples) have the same id?
"A programmer is just a tool which converts caffeine into code"

try out my skytest mod always being updated!
https://forum.minetest.net/viewtopic.php?f=9&t=17568
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] add colored plaster coats to nodes [plasterwork]

by Sokomine » Sun Jan 28, 2018 00:22

RSLRedstonier wrote:so in your code each color per node isn't a separate node?
so the red steelblock and the green steel block(just examples) have the same id?

That's right. All it takes to turn nodes into ones that can use this feature are a solid node with a promising texture (white works best) and the following in its definition:
Code: Select all
paramtype2 = "color",
palette = "name_of_palette_texture.png",

The palette is a tiny texture. MT uses param2 - which is normally used for rotation - for storing the color value. That means that you can use 256 colors per solid node where orientation doesn't matter - but only 8 for chests, stairs and so on.

Trouble is that while generating such colored node definitions and even placing them by mapgen are easy, handling through players is not. You have to somehow get these colored blocks. Crafting..does not really work with so many colors (and is afaik only partly implemented). Therefore, this machine came to be.
A list of my mods can be found here.
 

User avatar
RSLRedstonier
Member
 
Posts: 449
Joined: Wed May 10, 2017 21:00
Location: some were in middle earth
GitHub: RSL-Redstonier
In-game: RSLRedstonier

Re: [Mod] add colored plaster coats to nodes [plasterwork]

by RSLRedstonier » Sun Jan 28, 2018 00:53

*pretends to understand what your talking about and says* ah ok great work
"A programmer is just a tool which converts caffeine into code"

try out my skytest mod always being updated!
https://forum.minetest.net/viewtopic.php?f=9&t=17568
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] add colored plaster coats to nodes [plasterwork]

by Sokomine » Sun Jan 28, 2018 01:56

RSLRedstonier wrote:*pretends to understand what your talking about and says* ah ok great work

Just let your mod depend on mine then :) And add:
Code: Select all
plasterwork.register_plaster_node(
   "modname:name_of_your_node",
   "Description of node",
   "nice_white_texture.png",
   plasterwork.palette, -- you can add your own palette as well
   "default:cobble", -- what will be consumed by the machine
   2, -- how many blocks will be consumed for one output?
   "modname:source_block_name" -- what will be turned into a randomly colored one
);

That way you can add new blocks to this machine. Some nice white wood would probably be useful. And a suitable glass pane.
A list of my mods can be found here.
 

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

Re: [Mod] add colored plaster coats to nodes [plasterwork]

by TumeniNodes » Wed Jan 31, 2018 00:07

nice to see more uses for Mese.
this looks really nice, gonna give it a try
I'm not your buddy, guy...
 


Return to Mod Releases



Who is online

Users browsing this forum: Chem871 and 2 guests