[2 questions from noob]

User avatar
bosapara
Member
 
Posts: 362
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
In-game: Jozet

[2 questions from noob]

by bosapara » Wed Jul 11, 2018 08:14

1. Tried to add anvil mod from mine clone to default minetest, but it works only at 50% (tool + tool)
Tool + ingot/wood/stone = doesnt work. Checked 2 times all dependencies, "mcl_init" cant help too
mcl_anvils.zip
(8.99 KiB) Downloaded 10 times

Image

__________________________________________________

2. How to add 1 tree with L-system that will grow?

Checked code of "mochathicket" (simple tree mod) - got error

Code: Select all

minetest.register_node("mochathicket:mocha_blossom_leaves", {
  description = "Mocha Blossom Leaves",
  drawtype = "allfaces_optional",
  waving = true,
  visual_scale = moretrees_plantlike_leaves_visual_scale,
  tiles = { "mocha_blossom_leaves.png" },
  inventory_image = "mocha_blossom_leaves.png",
  paramtype = "light",
  groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1},
  drop = {
    max_items = 1,
    items = {
      {items = {"mochathicket:mocha_blossom_sapling"}, 20 },
      {items = {"mochathicket:mocha_blossom_leaves"} }
    }
  },
})

minetest.register_node("mochathicket:mocha_blossom_trunk", {
  description = "Mocha Blossom Trunk",
  tiles = {
    "mochathicket:mocha_blossom_trunk_top.png",
    "mochathicket:mocha_blossom_trunk_top.png",
    "mochathicket:mocha_blossom_trunk.png"
  },
  paramtype2 = "facedir",
  is_ground_content = true,
  groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
  on_place = minetest.rotate_node,
})

minetest.register_node("mochathicket:mocha_blossom_planks", {
  description = "Mocha Blossom Planks",
  tiles = {"mocha_blossom_wood.png"},
  is_ground_content = true,
  groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
})

minetest.register_node("mochathicket:mocha_blossom_sapling", {
  description = "Mocha Blossom Sapling",
  drawtype = "plantlike",
  tiles = {"mocha_blossom_sapling.png"},
  inventory_image = "mocha_blossom_sapling.png",
  paramtype = "light",
  paramtype2 = "waving",
  walkable = false,
  selection_box = {
    type = "fixed",
    fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
  },
  groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
})


mocha_blossom_model={
   axiom="FFFFFdddccA/FFFFFFcA/FFFFFFcB",
   rules_a="[&&&dddd^^ddddddd][&&&---dddd^^ddddddd][&&&+++dddd^^ddddddd][&&&++++++dddd^^ddddddd]",
   rules_b="[&&&ddd^^ddddd][&&&---ddd^^ddddd][&&&+++ddd^^ddddd][&&&++++++ddd^^ddddd]",
   rules_c="/",
   rules_d="F",
   trunk="mochathicket:mocha_blossom_trunk",
   leaves="mochathicket:mocha_blossom_leaves",
   angle=30,
   iterations=2,
   random_level=0,
   trunk_type="single",
   thin_branches=true
}
function grow_mocha_blossom(pos)
   minetest.remove_node(pos)
   if math.random(1,2) == 1 then
      minetest.spawn_tree(pos, mocha_blossom_model)
   else
      minetest.spawn_tree(pos, mocha_blossom_model)
   end
end
plantslib:grow_plants({
   grow_delay = 2,
   grow_chance = 4,
   grow_plant = "mochathicket:mocha_blossom_sapling",
   grow_nodes = "default:dirt_with_grass",
   grow_function = "grow_mocha_blossom"
})



minetest.register_abm({
   nodenames = {"mochathicket:mocha_blossom_sapling"},
   interval = 10,
   chance = 50,
   action = function(pos, node)
      local is_soil = minetest.registered_nodes[minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name].groups.soil
      if is_soil == nil or is_soil == 0 then return end
      print("A mocha blossom sapling grows into a tree at "..minetest.pos_to_string(pos))
      local vm = minetest.get_voxel_manip()
      local minp, maxp = vm:read_from_map({x=pos.x-16, y=pos.y, z=pos.z-16}, {x=pos.x+16, y=pos.y+16, z=pos.z+16})
      local a = VoxelArea:new{MinEdge=minp, MaxEdge=maxp}
      local data = vm:get_data()
      default.grow_tree(data, a, pos, math.random(1, 4) == 1, math.random(1,100000))
      vm:set_data(data)
      vm:write_to_map(data)
      vm:update_map()
   end
})


 

User avatar
voxelproof
Member
 
Posts: 589
Joined: Sat Aug 05, 2017 08:13
Location: Europe

Re: [2 questions from noob]

by voxelproof » Thu Jul 12, 2018 14:37

I'd advise you to address these questions in threads related to the mod (first question) and Minetest-related project (second one) within which you've experienced problems - greater chance to get a response than in general topics part of the Forum.
>>>there is life beyond the Cube>>>
 

User avatar
bosapara
Member
 
Posts: 362
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
In-game: Jozet

Re: [2 questions from noob]

by bosapara » Fri Jul 13, 2018 08:38

voxelproof wrote:I'd advise you to address these questions in threads related to the mod (first question) and Minetest-related project (second one) within which you've experienced problems - greater chance to get a response than in general topics part of the Forum.



Thank you for advice

PS Problem with spawn of tree with L-system solved
 


Return to Problems



Who is online

Users browsing this forum: No registered users and 2 guests