Complete redo

master
DonBatman 2016-03-24 11:55:46 -07:00
parent 0c1a655698
commit 987e0b49f6
5 changed files with 62 additions and 160 deletions

6
Readme.md Normal file
View File

@ -0,0 +1,6 @@
#myladders
Adds different style ladders in different colors to Minetest
Licence - DWYWPL

1
description.txt Normal file
View File

@ -0,0 +1 @@
Adds different style ladders that can be colored.

201
init.lua
View File

@ -1,32 +1,36 @@
myladders = {}
local ladders_mat = {
{"_black", "Black", "^[colorize:black:240"},
{"_blue", "Blue", "^[colorize:#0404B4:100"},
{"_brown", "Brown", "^[colorize:#190B07:160"},
{"_cyan", "Cyan", "^[colorize:cyan:120"},
{"_dark_green", "Dark Green", "^[colorize:#071907:200"},
{"_dark_grey", "Dark Grey", "^[colorize:black:200"},
{"_green", "Green", "^[colorize:green:160"},
{"_grey", "Grey", "^[colorize:black:150"},
{"_magenta", "Magenta", "^[colorize:magenta:160"},
{"_orange", "Orange", "^[colorize:orange:220"},
{"_pink", "Pink", "^[colorize:#FE2E9A:200"},
{"_red", "Red", "^[colorize:#B40404:200"},
{"_violet", "Violet", "^[colorize:#2F0B3A:220"},
{"_white", "White", "^[colorize:white:200"},
{"_yellow", "Yellow", "^[colorize:yellow:200"},
{"_wood", "Wood", ""},
}
myladders.colors = {
{"black", "Black", "^[colorize:black:240"},
{"blue", "Blue", "^[colorize:#0404B4:100"},
{"brown", "Brown", "^[colorize:#190B07:160"},
{"cyan", "Cyan", "^[colorize:cyan:120"},
{"dark_green", "Dark Green", "^[colorize:#071907:200"},
{"dark_grey", "Dark Grey", "^[colorize:black:200"},
{"green", "Green", "^[colorize:green:160"},
{"grey", "Grey", "^[colorize:black:150"},
{"magenta", "Magenta", "^[colorize:magenta:160"},
{"orange", "Orange", "^[colorize:orange:220"},
{"pink", "Pink", "^[colorize:#FE2E9A:200"},
{"red", "Red", "^[colorize:#B40404:200"},
{"violet", "Violet", "^[colorize:#2F0B3A:220"},
{"white", "White", "^[colorize:white:200"},
{"yellow", "Yellow", "^[colorize:yellow:200"},
}
for i in ipairs(ladders_mat) do
local mat = ladders_mat[i][1]
local desc = ladders_mat[i][2]
local alpha = ladders_mat[i][3]
local paintables = {
"myladders:treehouse", "myladders:heavy", "myladders:ladder"
}
for _, entry in ipairs(myladders.colors) do
local mat = entry[1]
local desc = entry[2]
local alpha = entry[3]
local ladders_type = { --Material , Description
{"myladders:treehouse", "Treehouse", "myladders_tree.obj","myladders_treewood.png^[transformR90"},
{"myladders:heavy", "Heavy Duty", "myladders_heavy.obj","myladders_heavy.png"},
{":default:ladder", "Default", "myladders_default.obj","default_wood.png"},
{"myladders:ladder", "Default", "myladders_default.obj","default_wood.png"},
}
for i in ipairs(ladders_type) do
@ -36,175 +40,52 @@ for i in ipairs(ladders_type) do
local img = ladders_type[i][4]
----------------------------------------------------------------------------------------
minetest.register_node(typ..mat, {
minetest.register_node(typ.."_"..mat, {
description = desc.." "..desct.." Ladder",
drawtype = "mesh",
mesh = mesht,
tiles = {img..alpha},
tiles = {img..alpha},
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
climbable = true,
is_ground_content = false,
groups = {choppy=2,flammable=1},
-- legacy_wallmounted = true,
selection_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, 0.375, 0.375, 0.5, 0.5},
}
},
sounds = default.node_sound_wood_defaults(),
sounds = default.node_sound_wood_defaults(),
})
end
end
--[[
minetest.register_craft({
type = "shapeless",
output = "myladders:treehouse_ladder_wood 2",
output = "myladders:ladder_brown 2",
recipe = {"default:ladder"}
})
minetest.register_craft({
type = "shapeless",
output = "myladders:treehouse_ladder_steel",
recipe = {"myladders:treehouse_ladder_wood","dye:grey"}
})
minetest.register_craft({
type = "shapeless",
output = "myladders:treehouse_ladder_black",
recipe = {"myladders:treehouse_ladder_wood","dye:black"}
})
--Heavy Duty
minetest.register_node("myladders:heavy_ladder_"..mat, {
description = desc.."Heavy Duty ladder",
drawtype = "mesh",
mesh = "myladders_heavy.obj",
tiles = {"default_wood.png"},
paramtype = "light",
-- tiles = {
-- "myladders_wood_front3.png"..alpha,
-- "myladders_wood_side2.png"..alpha,
-- "myladders_wood_side2.png"..alpha,
-- "myladders_wood_side2.png"..alpha,
-- "myladders_wood_front3.png"..alpha,
-- "myladders_wood_front3.png"..alpha,
-- },
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
climbable = true,
is_ground_content = false,
groups = {choppy=2,flammable=1},
legacy_wallmounted = true,
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, 0.3125, -0.25, 0.5, 0.5},
{0.25, -0.5, 0.3125, 0.375, 0.5, 0.5},
{-0.25, -0.125, 0.375, 0.25, -0.0625, 0.4375},
{-0.25, 0.125, 0.375, 0.25, 0.1875, 0.4375},
{-0.25, 0.375, 0.375, 0.25, 0.4375, 0.4375},
{-0.25, -0.375, 0.375, 0.25, -0.3125, 0.4375},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, 0.3125, 0.375, 0.5, 0.5},
}
},
sounds = default.node_sound_wood_defaults(),
output = "myladders:treehouse_ladder_brown 2",
recipe = {"default:ladder","default:stick"}
})
minetest.register_craft({
type = "shapeless",
output = "myladders:heavy_ladder_wood 1",
output = "myladders:heavy_ladder_brown 1",
recipe = {"default:ladder","default:ladder"}
})
minetest.register_craft({
type = "shapeless",
output = "myladders:heavy_ladder_steel",
recipe = {"myladders:heavy_ladder_wood","dye:grey"}
})
minetest.register_craft({
type = "shapeless",
output = "myladders:heavy_ladder_black",
recipe = {"myladders:heavy_ladder_wood","dye:black"}
})
if minetest.get_modpath("mypaint") then
local colors = {}
for _, entry in ipairs(myladders.colors) do
table.insert(colors, entry[1])
end
minetest.register_node(":default:ladder", {
description = "Ladder",
drawtype = "mesh",
mesh = "myladders_default.obj",
tiles = {"default_ladder_mesh.png"},
inventory_image = "default_ladder.png",
wield_image = "default_ladder.png",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = true,
climbable = true,
selection_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, 0.375, 0.375, 0.5, 0.5},
}
},
groups = {choppy=2,flammable=1},
legacy_wallmounted = true,
sounds = default.node_sound_wood_defaults(),
})
--[[
minetest.register_node("myladders:ladder_tin", {
description = "Tin Ladder",
drawtype = "nodebox",
tiles = {"myladders_ladder_tin_top.png",
"myladders_ladder_tin_bottom.png",
"myladders_ladder_tin_right.png",
"myladders_ladder_tin_left.png",
"myladders_ladder_tin_back.png",
"myladders_ladder_tin.png"},
inventory_image = "myladders_ladder_tin.png",
wield_image = "myladders_ladder_tin.png",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = true,
climbable = true,
node_box = {
type = "fixed",
fixed = {
{-0.375000,-0.500000,0.375000,-0.250000,0.500000,0.500000}, --NodeBox 1
{0.250000,-0.500000,0.375000,0.375000,0.500000,0.500000}, --NodeBox 2
{-0.250000,0.437500,0.375000,0.250000,0.312500,0.500000}, --NodeBox 3
{-0.250000,0.062500,0.375000,0.250000,0.187500,0.500000}, --NodeBox 4
{-0.250000,-0.187500,0.375000,0.250000,-0.062500,0.500000}, --NodeBox 5
{-0.250000,-0.437500,0.375000,0.250000,-0.312500,0.500000}, --NodeBox 6
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.375,-0.5,0.375,0.375,0.5,0.5},
},
},
groups = {cracky = 3},
legacy_wallmounted = true,
sounds = default.node_sound_wood_defaults(),
})
minetest.register_craft({
output = "myladders:ladder_tin 5",
recipe = {
{'moreores:tin_ingot', '', 'moreores:tin_ingot'},
{'moreores:tin_ingot', 'moreores:tin_ingot', 'moreores:tin_ingot'},
{'moreores:tin_ingot', '', 'moreores:tin_ingot'}
}
})
--]]
mypaint.register(paintables, colors)
end

13
licence.txt Normal file
View File

@ -0,0 +1,13 @@
DO WHAT YOU WANT TO PUBLIC LICENSE
or abbreviated DWYWPL
December 2nd 2015
License Copyright (C) 2015 Michael Tomaino (PlatinumArts@gmail.com)
www.sandboxgamemaker.com/DWYWPL/
DO WHAT YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
1. You are allowed to do whatever you want to with what content is using this license.
2. This content is provided 'as-is', without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this content.

1
mod.conf Normal file
View File

@ -0,0 +1 @@
name = myladders