BTW - BETTER THAN WOOL - MOD

Post Reply
User avatar
ForgiveAndromedalol
Member
Posts: 225
Joined: Tue Apr 11, 2017 12:34
GitHub: ForgiveAndromedalol
IRC: Andromeda
In-game: Yam

BTW - BETTER THAN WOOL - MOD

by ForgiveAndromedalol » Post

BETTER THAN WOOL (BTW) These are blocks who comes from wool. This mod its purpose is to create statues with a block much better than wool. The advantage of this mod it's that you can create statues with no lightning problems, more variety of colors.

RECIPES

IF YOU COOK wool:red, YOU CAN GET btw:red.
WITH btw:red YOU CAN CRAFT IT WITH dye:white AND YOU CAN GET btw:red_light.

IT'S THE SAME PROCESS WITH OTHER COLORS.

ALSO HERE ARE SKIN TONES FOR IF YOU WANT TO GET BETTER TONES FOR SKINS FOR STATUES.

INSTALLATION

UNCOMPRESS THE ZIP FOLDER, AND MOVE THE btw FILE TO /mods file in minetest folder. n_n

DOWNLOAD LINK: https://github.com/ForgiveAndromedalol/btw.git
(btw blue light and blue dark fixed)
DEPENDS: default, wool, dye

LOOK AT THIS STATUE IN A DARK AREA, AND IT'S GLOWING (MADE WITH btw). COMPARE TO THE OTHER STATUE BESIDES - MADE WITH WOOL.
Image

Image
YOU CAN GET btw:red/yellow/orange/blue/cyan/magenta/brown/pin[/img]k/black/white BY COOKING WOOL OF THOSE RESPECTIVE COLORS.
Image
ALSO YOU CAN DO THE SAME, BUT REVERSED:
Image

WHEN YOU GET THE COLORS, YOU CAN CRAFT IT AND GET LIGHNING OR DARK btw COLORS. FOR EXAMPLE - AND IT APPLIES TO OTHER COLORS:
IF I WOULD LIKE TO GET LIGHNING RED, I WOULD CRAFT:
btw:red, dye:white, ""
"", "" , ""
OR DARK RED:
btw:red, dye:black, ""
"", "" , ""

IN THE CASE OF SKIN TONES, THERE ARE SPECIFIED CRAFTS - SO YOU NEED TO CHECK ON YOUR REGISTRY (CRAFTING MANUAL).
Image

ENJOY THIS MOD.
Last edited by ForgiveAndromedalol on Sat Jun 03, 2017 15:15, edited 2 times in total.
My MODS: Water Colors - viewtopic.php?f=9&t=18241
BTW BLOCKS - viewtopic.php?f=9&t=17654

User avatar
D00Med
Member
Posts: 943
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: BTW - BETTER THAN WOOL - MOD

by D00Med » Post

WOW xD
This is a really good idea, I will try it out
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: BTW - BETTER THAN WOOL - MOD

by azekill_DIABLO » Post

awesome idea! okay, the craft is everything but not realistic ... but +1 anyway, it's a must.

User avatar
ForgiveAndromedalol
Member
Posts: 225
Joined: Tue Apr 11, 2017 12:34
GitHub: ForgiveAndromedalol
IRC: Andromeda
In-game: Yam

Re: BTW - BETTER THAN WOOL - MOD

by ForgiveAndromedalol » Post

n_n. Yea, it's not real, but funny. And thanks to try my mod. I need to fix blue light command.
Image
My MODS: Water Colors - viewtopic.php?f=9&t=18241
BTW BLOCKS - viewtopic.php?f=9&t=17654

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: BTW - BETTER THAN WOOL - MOD

by azekill_DIABLO » Post

nice idea, should be default somehow.

User avatar
ForgiveAndromedalol
Member
Posts: 225
Joined: Tue Apr 11, 2017 12:34
GitHub: ForgiveAndromedalol
IRC: Andromeda
In-game: Yam

Re: BTW - BETTER THAN WOOL - MOD

by ForgiveAndromedalol » Post

azekill_DIABLO wrote:nice idea, should be default somehow.
lol n_n.
My MODS: Water Colors - viewtopic.php?f=9&t=18241
BTW BLOCKS - viewtopic.php?f=9&t=17654

User avatar
ForgiveAndromedalol
Member
Posts: 225
Joined: Tue Apr 11, 2017 12:34
GitHub: ForgiveAndromedalol
IRC: Andromeda
In-game: Yam

Re: BTW - BETTER THAN WOOL - MOD

by ForgiveAndromedalol » Post

I created this mod, because Jordach's wool mod isn't available - you know the wool mod with all color pallets. So I decided to create this mod. But... It isn't perfect. If someone has the jordach's wool mod, please, upload it.
Last edited by ForgiveAndromedalol on Sat May 27, 2017 22:52, edited 1 time in total.
My MODS: Water Colors - viewtopic.php?f=9&t=18241
BTW BLOCKS - viewtopic.php?f=9&t=17654

User avatar
ForgiveAndromedalol
Member
Posts: 225
Joined: Tue Apr 11, 2017 12:34
GitHub: ForgiveAndromedalol
IRC: Andromeda
In-game: Yam

Re: BTW - BETTER THAN WOOL - MOD

by ForgiveAndromedalol » Post

Image
Attachments
screenshot_20170527_195326.png
(389.73 KiB) Not downloaded yet
Last edited by ForgiveAndromedalol on Sat May 27, 2017 22:53, edited 1 time in total.
My MODS: Water Colors - viewtopic.php?f=9&t=18241
BTW BLOCKS - viewtopic.php?f=9&t=17654

User avatar
ForgiveAndromedalol
Member
Posts: 225
Joined: Tue Apr 11, 2017 12:34
GitHub: ForgiveAndromedalol
IRC: Andromeda
In-game: Yam

Re: BTW - BETTER THAN WOOL - MOD

by ForgiveAndromedalol » Post

Image

mixing wool and btw. Made by Blasus.
Image
Attachments
screenshot_20170527_194913.png
(410.9 KiB) Not downloaded yet
screenshot_20170527_194735.png
(930.42 KiB) Not downloaded yet
Last edited by ForgiveAndromedalol on Wed May 31, 2017 17:38, edited 1 time in total.
My MODS: Water Colors - viewtopic.php?f=9&t=18241
BTW BLOCKS - viewtopic.php?f=9&t=17654

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: BTW - BETTER THAN WOOL - MOD

by azekill_DIABLO » Post

BTW btw is a nice mod!

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: BTW - BETTER THAN WOOL - MOD

by the_raven_262 » Post

This is a good idea actually, would be nice if there was a server for pixel art.
You used textures for this, did you know there is an easier way?
Minetest has the colorize function, you would only need one texture for this, but well, you could also have registered them using a for loop, which shortens the mod considerably.
Also, did you notice there is a certain button named "Caps Lock" on you keyboard?
You shouldn't write the whole post in capital letters, people will think you are shouting (just an advice).
[amber] [conjuration] [warzone] | Why is #minetest-mod-dev so empty?

User avatar
ForgiveAndromedalol
Member
Posts: 225
Joined: Tue Apr 11, 2017 12:34
GitHub: ForgiveAndromedalol
IRC: Andromeda
In-game: Yam

Re: BTW - BETTER THAN WOOL - MOD

by ForgiveAndromedalol » Post

the_raven_262 wrote:This is a good idea actually, would be nice if there was a server for pixel art.
You used textures for this, did you know there is an easier way?
Minetest has the colorize function, you would only need one texture for this, but well, you could also have registered them using a for loop, which shortens the mod considerably.
Also, did you notice there is a certain button named "Caps Lock" on you keyboard?
You shouldn't write the whole post in capital letters, people will think you are shouting (just an advice).
In my server already has btw mod. Andromeda (Survival Pvp) maestreapvp.ddnsking.com 30000

***And sorry if I typed with capital letter - it's because I was really lazy n_n.
My MODS: Water Colors - viewtopic.php?f=9&t=18241
BTW BLOCKS - viewtopic.php?f=9&t=17654

BBmine
Member
Posts: 3475
Joined: Sun Jul 12, 2015 22:51
GitHub: BBmine
IRC: BBmine
In-game: Baggins
Location: USA

Re: BTW - BETTER THAN WOOL - MOD

by BBmine » Post

WOW! Will download now! Good job Yam!!! :D

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: BTW - BETTER THAN WOOL - MOD

by the_raven_262 » Post

What I also wanted to say is that this mod can be shortened considerably, no need for extra text in the init.lua or all those textures.
I'll try to explain it here, it shouldn't be too hard to understand if i make it step by step.

Firstly all of your nodes are registered by the same way, every node has exactly the same definition.

Code: Select all

minetest.register_node("btw:red", {
	description = "RED BLOCK",
	tiles = {"red.png"},
	is_ground_content = true,
	groups = {cracky=3},
	sounds = default.node_sound_glass_defaults(),
	light_source = 6,
	paramtype = "light",
	use_texture_alpha = false,
	drawtype = "glasslike",
	sunlight_propagates = true,
})
Notice how e.g. group is always cracky=3, sounds always glass etc.
To shorten this you could use a for loop, repeating this same part of the code, just every time with different variables.
To do that we first need a table of our desired colours.

Code: Select all

local colors = {
    {"red", "Red", "FF0000"},
    {"orange", "Orange", "FF8000"},
    {"yellow", "Yellow", "FFFF00"},
    {"green", "Green", "00FF00"},
    {"darkgreen", "Dark Green", "008000"},
    {"blue", "Blue", "0000FF"},
    {"violet", "Violet", "8000FF"},
    {"pink", "Pink", "FF00FF"},
    {"magenta", "Magenta", "FF0080"},
    {"brown", "Brown", "400C00"},
    {"white", "White", "FFFFFF"},
    {"grey", "Grey", "808080"},
    {"darkgrey", "Dark Grey", "404040"},
    {"black", "Black", "000000"},
}
This is one of the ways to do it, basically first variable in every row is "coding name", the we'll use it to create nodes coding name (e.g. "default:sandstone" is a coding name).
The second one in the row is always the so called "real name", basically same thing, just starts with a capital letter since we use this one to create node's description.
Third one might be harder to understand, it is hex code of a colour. Every colour has a hex code (the amount of red, green and blue colour in the colour in hexadecimal system). Since we don't use hexadecimal system in real life too much you probably didn't know of it, you don't need to since you can easily convert every colour to it here.

Now we need to implement this table.
Firstly this table need to be in the same file and above the for loop, which we are now creating.
To start the for loop type the line

Code: Select all

for _, rowc in ipairs(colors) do
You'll need to define which column of the table does what, like this:

Code: Select all

local coding_name = rowc[1]
local real_name = rowc[2]
local hex_color = rowc[3]
And now that we have defined the columns, we can use these variables in the node definition.
To use the certain variable in the node definition, first we need to check which variable does what.
As I said before, first column consists of coding names, we'll use this one to create node's coding name.

Code: Select all

minetest.register_node("btw:" .. coding_name,
This will give us output such as "btw:red" for the red colour for example.
But this is only the first variable, we will also use real name to create descriptions.

Code: Select all

description = real_name .. " Node",
You can make the description to your liking, this one makes red node's description be "Red Node".
Also notice that i created an intentional space before the "Node" part, or the name would be all in one word.
The third variable is our colour, this is why registering like this is much easier.
Before we start this one, you'll need a texture of whichever size you prefer, coloured into gray colour.
e.g. btw_gray.png will be used in this example.

Code: Select all

tiles = {"btw_gray.png^[colorize:#" .. hex_color .. "80"},
Here you can see that I colorized the gray texture into specific colour which is defined by the hex_color variable.
You can find out more about texture modifiers here.
The number 80 in the last part of this table is the intensity of the colour, the alpha channel.
You can also call it saturnation in this case, cause we are using the gray texture as the base.

Now, we have all the variables inserted in the code, it should look like this:

Code: Select all

for _, rowc in ipairs(colours) do
        local coding_name = rowc[1]
        local real_name = rowc[2]
	    local hex_color = rowc[3]
minetest.register_node("btw:" .. coding_name, {
	description = real_name .. " Block",
	tiles = {"btw_gray.png^[colorize:#" .. hex_color .. "80"},
	is_ground_content = true,
	groups = {cracky=3},
	sounds = default.node_sound_glass_defaults(),
	light_source = 6,
	paramtype = "light",
	use_texture_alpha = false,
	drawtype = "glasslike",
	sunlight_propagates = true,
})
end
This is how you make the node definitions, but you'll also want to register crafting recipes.
This is easy now.
Now you can use these variables in any part of the code you want that is inside the for loop, before that "end" that is.
So, registering cooking recipes? Like this:

Code: Select all

minetest.register_craft({
	type = "cooking",
	recipe = "wool:" .. coding_name,
	output = "btw:" .. coding_name,
})
And place that before the end, i say this again since this part is useless if placed anywhere else.
Now, this will register cooking recipes for e.g. red nodes, but if you make a colour that doesn't exist in wool mod, you won't get a cooking recipe.
You'll also require the opposite recipe if you want nodes back to wool.

Now that you have the basic understanding of how for loop works, you can experiment a bit, that is why I didn't make the rest of the code for you.

I shall also mention the use of the if/else loop.
For example if you need all of the nodes except for the gray one colorized (cause it is gray already), you'll exclude the gray node from colorizing.

Code: Select all

if hex_color == "808080" then
(definition of the gray node)
end
This should be placed at the beginning of the for loop, also leading to the node definition with "else".

Code: Select all

else
(the definition of the rest of the nodes)
end
This way the gray nodes will not be colorized, but the rest will.
If/else loops can also be applied when making crafting recipes, cooking recipes and whatever rest you might think of.
[amber] [conjuration] [warzone] | Why is #minetest-mod-dev so empty?

User avatar
ForgiveAndromedalol
Member
Posts: 225
Joined: Tue Apr 11, 2017 12:34
GitHub: ForgiveAndromedalol
IRC: Andromeda
In-game: Yam

Re: BTW - BETTER THAN WOOL - MOD

by ForgiveAndromedalol » Post

the_raven_262 wrote:What I also wanted to say is that this mod can be shortened considerably, no need for extra text in the init.lua or all those textures.
I'll try to explain it here, it shouldn't be too hard to understand if i make it step by step.

Firstly all of your nodes are registered by the same way, every node has exactly the same definition.

Code: Select all

minetest.register_node("btw:red", {
	description = "RED BLOCK",
	tiles = {"red.png"},
	is_ground_content = true,
	groups = {cracky=3},
	sounds = default.node_sound_glass_defaults(),
	light_source = 6,
	paramtype = "light",
	use_texture_alpha = false,
	drawtype = "glasslike",
	sunlight_propagates = true,
})
Notice how e.g. group is always cracky=3, sounds always glass etc.
To shorten this you could use a for loop, repeating this same part of the code, just every time with different variables.
To do that we first need a table of our desired colours.

Code: Select all

local colors = {
    {"red", "Red", "FF0000"},
    {"orange", "Orange", "FF8000"},
    {"yellow", "Yellow", "FFFF00"},
    {"green", "Green", "00FF00"},
    {"darkgreen", "Dark Green", "008000"},
    {"blue", "Blue", "0000FF"},
    {"violet", "Violet", "8000FF"},
    {"pink", "Pink", "FF00FF"},
    {"magenta", "Magenta", "FF0080"},
    {"brown", "Brown", "400C00"},
    {"white", "White", "FFFFFF"},
    {"grey", "Grey", "808080"},
    {"darkgrey", "Dark Grey", "404040"},
    {"black", "Black", "000000"},
}
This is one of the ways to do it, basically first variable in every row is "coding name", the we'll use it to create nodes coding name (e.g. "default:sandstone" is a coding name).
The second one in the row is always the so called "real name", basically same thing, just starts with a capital letter since we use this one to create node's description.
Third one might be harder to understand, it is hex code of a colour. Every colour has a hex code (the amount of red, green and blue colour in the colour in hexadecimal system). Since we don't use hexadecimal system in real life too much you probably didn't know of it, you don't need to since you can easily convert every colour to it here.

Now we need to implement this table.
Firstly this table need to be in the same file and above the for loop, which we are now creating.
To start the for loop type the line

Code: Select all

for _, rowc in ipairs(colors) do
You'll need to define which column of the table does what, like this:

Code: Select all

local coding_name = rowc[1]
local real_name = rowc[2]
local hex_color = rowc[3]
And now that we have defined the columns, we can use these variables in the node definition.
To use the certain variable in the node definition, first we need to check which variable does what.
As I said before, first column consists of coding names, we'll use this one to create node's coding name.

Code: Select all

minetest.register_node("btw:" .. coding_name,
This will give us output such as "btw:red" for the red colour for example.
But this is only the first variable, we will also use real name to create descriptions.

Code: Select all

description = real_name .. " Node",
You can make the description to your liking, this one makes red node's description be "Red Node".
Also notice that i created an intentional space before the "Node" part, or the name would be all in one word.
The third variable is our colour, this is why registering like this is much easier.
Before we start this one, you'll need a texture of whichever size you prefer, coloured into gray colour.
e.g. btw_gray.png will be used in this example.

Code: Select all

tiles = {"btw_gray.png^[colorize:#" .. hex_color .. "80"},
Here you can see that I colorized the gray texture into specific colour which is defined by the hex_color variable.
You can find out more about texture modifiers here.
The number 80 in the last part of this table is the intensity of the colour, the alpha channel.
You can also call it saturnation in this case, cause we are using the gray texture as the base.

Now, we have all the variables inserted in the code, it should look like this:

Code: Select all

for _, rowc in ipairs(colours) do
        local coding_name = rowc[1]
        local real_name = rowc[2]
	    local hex_color = rowc[3]
minetest.register_node("btw:" .. coding_name, {
	description = real_name .. " Block",
	tiles = {"btw_gray.png^[colorize:#" .. hex_color .. "80"},
	is_ground_content = true,
	groups = {cracky=3},
	sounds = default.node_sound_glass_defaults(),
	light_source = 6,
	paramtype = "light",
	use_texture_alpha = false,
	drawtype = "glasslike",
	sunlight_propagates = true,
})
end
This is how you make the node definitions, but you'll also want to register crafting recipes.
This is easy now.
Now you can use these variables in any part of the code you want that is inside the for loop, before that "end" that is.
So, registering cooking recipes? Like this:

Code: Select all

minetest.register_craft({
	type = "cooking",
	recipe = "wool:" .. coding_name,
	output = "btw:" .. coding_name,
})
And place that before the end, i say this again since this part is useless if placed anywhere else.
Now, this will register cooking recipes for e.g. red nodes, but if you make a colour that doesn't exist in wool mod, you won't get a cooking recipe.
You'll also require the opposite recipe if you want nodes back to wool.

Now that you have the basic understanding of how for loop works, you can experiment a bit, that is why I didn't make the rest of the code for you.

I shall also mention the use of the if/else loop.
For example if you need all of the nodes except for the gray one colorized (cause it is gray already), you'll exclude the gray node from colorizing.

Code: Select all

if hex_color == "808080" then
(definition of the gray node)
end
This should be placed at the beginning of the for loop, also leading to the node definition with "else".

Code: Select all

else
(the definition of the rest of the nodes)
end
This way the gray nodes will not be colorized, but the rest will.
If/else loops can also be applied when making crafting recipes, cooking recipes and whatever rest you might think of.
Wow. That's cool n_n. And I don't need to use an excess of textures. That's nice. Let me try this code, then I'll add to github and your name for the collaboration you did. Thanks n_n.
My MODS: Water Colors - viewtopic.php?f=9&t=18241
BTW BLOCKS - viewtopic.php?f=9&t=17654

muhdnurhidayat
Member
Posts: 302
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: muhdnurhidayat
In-game: muhdnurhidayat
Location: Wangsa Maju, Kuala Lumpur, Malaysia
Contact:

Re: BTW - BETTER THAN WOOL - MOD

by muhdnurhidayat » Post

the_raven_262 wrote: ...

Code: Select all

local colors = {
    {"red", "Red", "FF0000"},
    {"orange", "Orange", "FF8000"},
    {"yellow", "Yellow", "FFFF00"},
    {"green", "Green", "00FF00"},
    {"darkgreen", "Dark Green", "008000"},
    {"blue", "Blue", "0000FF"},
    {"violet", "Violet", "8000FF"},
    {"pink", "Pink", "FF00FF"},
    {"magenta", "Magenta", "FF0080"},
    {"brown", "Brown", "400C00"},
    {"white", "White", "FFFFFF"},
    {"grey", "Grey", "808080"},
    {"darkgrey", "Dark Grey", "404040"},
    {"black", "Black", "000000"},
}
...
The second one in the row is always the so called "real name", basically same thing, just starts with a capital letter since we use this one to create node's description.
...
I came here from IRC... :P
Could the loop method be used with intllib too?
Usually real name is using function S("Some Name") if it's supporting intllib.
The S is from local S, NS = dofile(modpath.."/intllib.lua")
[ Full signature ] - UTC+8 here, I'm muhdnurhidayat in most Minetest servers. / Twitter ✂️- - - - -

Contributes to Minetest Wiki.
Also uses MT Offtopic forum.
You just read my profile, right?
Because these few texts of signature only appear on profile page as the texts are cut in signature. xD

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: BTW - BETTER THAN WOOL - MOD

by the_raven_262 » Post

I never used intlib, but i will check if this is possible.
[amber] [conjuration] [warzone] | Why is #minetest-mod-dev so empty?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests