stuck attemping mod support for cblocks

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

stuck attemping mod support for cblocks

by TumeniNodes » Fri Jul 01, 2016 01:11

When it loads, I only get yellow version of each object. And the glass is not transparent.

Image

Everything on the other end is all set... I just run into issues if I try to add:
drawtype = "glasslike",
paramtype = "light",... etc.
I get an error which states I need to put a ')' to close '(' at '='

here's the code I have so far, which loads fine but, as I stated. I only end up with a yellow,wood... yellow, stonebrick... and a yellow,solid glass angled walls. Any ideas? I'm stumped, I have tried numerous ways, I just don't know what I am doing wrong?

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local colours = {
   {"black",      "Black",      "#000000b0"},
   {"blue",       "Blue",       "#015dbb70"},
   {"brown",      "Brown",      "#a78c4570"},
   {"cyan",       "Cyan",       "#01ffd870"},
   {"dark_green", "Dark Green", "#005b0770"},
   {"dark_grey",  "Dark Grey",  "#303030b0"},
   {"green",      "Green",      "#61ff0170"},
   {"grey",       "Grey",       "#5b5b5bb0"},
   {"magenta",    "Magenta",    "#ff05bb70"},
   {"orange",     "Orange",     "#ff840170"},
   {"pink",       "Pink",       "#ff65b570"},
   {"red",        "Red",        "#ff000070"},
   {"violet",     "Violet",     "#2000c970"},
   {"white",      "White",      "#abababc0"},
   {"yellow",     "Yellow",     "#e3ff0070"},
}

for i = 1, #colours, 1 do

-- wood

angledwalls.register_angled_wall_and_low_angled_wall("cblockswood","cblocks:wood_" .. colours[i][1],
   {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
   {"default_wood.png^[colorize:" .. colours[i][3]},
   colours[i][2] .. " Wooden Planks Angled Wall",
   colours[i][2] .. " Wooden Planks Low Angled Wall",
   default.node_sound_wood_defaults())

-- stone brick

angledwalls.register_angled_wall_and_low_angled_wall("cblocksstonebrick","cblocks:stonebrick_" .. colours[i][1],
   {cracky = 2, stone = 1},
   {"default_stone_brick.png^[colorize:" .. colours[i][3]},
   colours[i][2] .. " Stone Brick Angled Wall",
   colours[i][2] .. " Stone Brick Low Angled Wall",
   default.node_sound_stone_defaults())

-- glass

angledwalls.register_angled_wall_and_low_angled_wall("cblocksglass","cblocks:glass_" .. colours[i][1],
   {cracky = 3, oddly_breakable_by_hand = 3},
   {"cblocks.png^[colorize:" .. colours[i][3]},
   colours[i][2] .. " Glass Angled Wall",
   colours[i][2] .. " Glass Low Angled Wall",
   default.node_sound_glass_defaults())
end
Attachments
cblocks yellow only.png
cblocks yellow only.png (93.72 KiB) Viewed 1664 times
Last edited by TumeniNodes on Fri Jul 01, 2016 02:10, edited 2 times in total.
Flick?... Flick who?
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: stuck attemping mod support for cblocks

by TumeniNodes » Fri Jul 01, 2016 02:00

Do I need to have "dye" as a depends?
nvm, it didn't resolve the issue
Flick?... Flick who?
 

KCoombes
Member
 
Posts: 278
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt or Rudilyn

Re: stuck attemping mod support for cblocks

by KCoombes » Fri Jul 01, 2016 03:22

try:

{"default_wood.png^[colorize:" .. colours[i][3]]},

and
default.node_sound_wood_defaults(),
)
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: stuck attemping mod support for cblocks

by TumeniNodes » Fri Jul 01, 2016 05:15

KCoombes wrote:try:

{"default_wood.png^[colorize:" .. colours[i][3]]},

and
default.node_sound_wood_defaults(),
)


Thank you KCoombes...
this is throwing errors though.
I'm gonna get some sleep, and maybe the solution will be more clear tomorrow afternoon : )
Flick?... Flick who?
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: stuck attemping mod support for cblocks

by TumeniNodes » Fri Jul 01, 2016 18:45

Do I need to register every single colored node for this to work? I sure hope not.
That is how I was able to get bakedclay supported but, even as a soft depends, if bakedclay is not enabled, the bakedclay/angled walls are still in inv and useable (so maybe I did that support wrong)?
(heavy sigh)
Flick?... Flick who?
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: stuck attemping mod support for cblocks

by duane » Fri Jul 01, 2016 21:31

TumeniNodes wrote:When it loads, I only get yellow version of each object.


It sounds as though someone at some point is copying a reference to a table, when they mean to be copying the table. I don't have the mod you're using, so it's hard to say.

You might also look at the first argument to your functions. Is it supposed to be the same for multiple nodes? Normally, I'd expect to have to make every argument for a different node, distinct. (Again, I don't have the code.)
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: stuck attemping mod support for cblocks

by TumeniNodes » Fri Jul 01, 2016 22:25

Well, this is the init.lua for angledwalls

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
angledwalls = {}
dofile(minetest.get_modpath("angledwalls").."/angledwalls.lua")
dofile(minetest.get_modpath("angledwalls").."/cblocks.lua")
dofile(minetest.get_modpath("angledwalls").."/bakedclay.lua")
dofile(minetest.get_modpath("angledwalls").."/quartz.lua")


local mod_cblocks = minetest.get_modpath("cblocks")
local mod_bakedclay = minetest.get_modpath("bakedclay")
local mod_quartz = minetest.get_modpath("quartz")


if mod_cblocks then
   dofile(minetest.get_modpath("angledwalls").."/cblocks.lua")
   
   end

if mod_bakedclay then
   dofile(minetest.get_modpath("angledwalls").."/bakedclay.lua")
   
   end

if mod_quartz then
   dofile(minetest.get_modpath("angledwalls").."/quartz.lua")
   
   end


then, the cblocks.lua is posted above, in the original post.
I just don't know..., I mean, if I have to have the cblocks.lua register every color of every node, I am ok with that (it's a lot of typing) but, I don;t know of any other ways..., because I cannot seem to figure out how to get cblocks to work with angledwalls using the nice, clean, simple script cblocks uses.
Flick?... Flick who?
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: stuck attemping mod support for cblocks

by TumeniNodes » Fri Jul 01, 2016 22:29

and here is the original cblocks init.lua
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local colours = {
   {"black",      "Black",      "#000000b0"},
   {"blue",       "Blue",       "#015dbb70"},
   {"brown",      "Brown",      "#a78c4570"},
   {"cyan",       "Cyan",       "#01ffd870"},
   {"dark_green", "Dark Green", "#005b0770"},
   {"dark_grey",  "Dark Grey",  "#303030b0"},
   {"green",      "Green",      "#61ff0170"},
   {"grey",       "Grey",       "#5b5b5bb0"},
   {"magenta",    "Magenta",    "#ff05bb70"},
   {"orange",     "Orange",     "#ff840170"},
   {"pink",       "Pink",       "#ff65b570"},
   {"red",        "Red",        "#ff000070"},
   {"violet",     "Violet",     "#2000c970"},
   {"white",      "White",      "#abababc0"},
   {"yellow",     "Yellow",     "#e3ff0070"},
}

for i = 1, #colours, 1 do

-- wood

minetest.register_node("cblocks:wood_" .. colours[i][1], {
   description = colours[i][2] .. " Wooden Planks",
   tiles = {"default_wood.png^[colorize:" .. colours[i][3]},
   paramtype = "light",
   is_ground_content = false,
   groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
   sounds = default.node_sound_wood_defaults(),
})

minetest.register_craft({
   output = "cblocks:wood_".. colours[i][1] .. " 2",
   recipe = {
      {"group:wood","group:wood", "dye:" .. colours[i][1]},
   }
})

-- stone brick

minetest.register_node("cblocks:stonebrick_" .. colours[i][1], {
   description = colours[i][2] .. " Stone Brick",
   tiles = {"default_stone_brick.png^[colorize:" .. colours[i][3]},
   paramtype = "light",
   is_ground_content = false,
   groups = {cracky = 2, stone = 1},
   sounds = default.node_sound_stone_defaults(),
})

minetest.register_craft({
   output = "cblocks:stonebrick_".. colours[i][1] .. " 2",
   recipe = {
      {"default:stonebrick","default:stonebrick", "dye:" .. colours[i][1]},
   }
})

-- glass

minetest.register_node( "cblocks:glass_" .. colours[i][1], {
   description = colours[i][2] .. " Glass",
   tiles = {"cblocks.png^[colorize:" .. colours[i][3]},
   drawtype = "glasslike",
   paramtype = "light",
   sunlight_propagates = true,
   use_texture_alpha = true,
   is_ground_content = false,
   groups = {cracky = 3, oddly_breakable_by_hand = 3},
   sounds = default.node_sound_glass_defaults(),
})

minetest.register_craft({
   output = "cblocks:glass_".. colours[i][1] .. " 2",
   recipe = {
      {"default:glass","default:glass", "dye:" .. colours[i][1]},
   }
})

end

print ("[MOD] Cblocks loaded")
Flick?... Flick who?
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: stuck attemping mod support for cblocks

by duane » Sat Jul 02, 2016 01:33

Ok, if this is the register_angled_wall function you're using, then basically you're telling it:

minetest.register_node(":angledwalls:angled_wallcblockswood"...

for every color. Register node is then replacing every instance of your new node with each subsequent instance under the same name. (A table is used to store them all, keyed by name.) Needless to say, that leaves you with the last one you registered and no others.

You need to change the name of each colored node, as you were considering earlier. All nodes must have a different name. The color name is the obvious choice to append.

As for the transparency, does your texture file actually have alpha transparency?
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: stuck attemping mod support for cblocks

by TumeniNodes » Sat Jul 02, 2016 17:28

I'm going to give up on cblocks support. cblocks does not use textures, it adds tints of colors to textures.
There is one texture it uses, I assume for glass. I added it to the textures for angledwalls
Anyway, my patience level is not what it used to be, so I will put cblocks support aside at this time. As I ststed, I only get the yellow of the wood, stone brick, and glass. I did not register any actual nodes, with textures, it just gave me those 2 in yellow. And as I stated the glass angled walls were not transparent.
The issue is not with the cblocks code, but with my inexperience.
Flick?... Flick who?
 


Return to Modding Discussion

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron