tkerwel wrote:to do:
- make sure that a tree dont grow where already something is build (this realy gives me some pain ....)
tkerwel wrote:@Neuromancer
thats not that easy.... i dont have a problem to check if the node above is air or not... but this is not the whole truth.
normaly you have to check the whole shape of the tree to see if there is something interfearing with the node you want to place. as i use random shapes for different grows with the abm its hard to write a routine for that.
so the tree grow routine has to run 2 times, first to check if every node i want to place something is free and then if there is no interfearing with something place them.
my trys so far are all not working well.
if i dont get a "glory" idea today i think i will offer this as mod in a kind of alpha version. cause i think if other can work with this code, they might have this "glory" idea to put into this mod.
tkerwel wrote:known mistakes:
- i dont get why i can go thru the birch leaves but not thru the pine leaves, maybe somebody can find this mistake
minetest.register_node("tk:tk_birch_leaves", {
description = "tk_birch_leaves",
tile_images = {"tk_birch_leaves.png"},
inventory_image = "tk_birch_leaves.png",
wield_image = "tk_birch_leaves.png",
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
--[[
node_box = {
type = "fixed",
},
--]]
groups = {tree=1,snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=2},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/10 chance
items = {'tk:tk_birch_sapling'},
rarity = 10,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {'default:leaves'},
}
}
},
sounds = default.node_sound_leaves_defaults()
})
mauvebic wrote:Assuming he's using an ABM to spawn the tree, how does he use the tree/trunk to assign a facedir to the leaves? (could come in handy :-))
tkerwel wrote:Stef wrote:nice but i want a blocky trunk
thats no problem just delete in the code the fixed = slopebox
from
node_box = {
type = "fixed",
fixed = slopebox,
},
to
node_box = {
type = "fixed",
},
and the mod use a cube/blocky trunk again....
hmm maybe i should build in a posibility to switch between round/blocky trunk's ...one more point on my feature list for that mod....
thanks Stef
Users browsing this forum: No registered users and 9 guests