burli wrote:found this. It's working now.
viewtopic.php?f=12&t=9400
Will they be randomly selected if I use _# like other media files or do I have to generate the filename myself?
What I don't like is that I can only use the corner to place schematics, not the center.
KCoombes wrote:you would need to create the filename yourself for each tree schematic you save, but the random generation is handled by code in the mapgen file
minetest.place_schematic(pos, "tree.mts", rotation, replacements, force_placement)burli wrote:KCoombes wrote:you would need to create the filename yourself for each tree schematic you save, but the random generation is handled by code in the mapgen file
I know that I have to enter the filename myself. I just want to know if multiple files with _# ending will be loaded randomly like with textures or sound files or if I have to code this myself
For example: I have the files tree_1.mts, tree_2.mts, tree_3.mts
can I use the codeYour 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
minetest.place_schematic(pos, "tree.mts", rotation, replacements, force_placement)
and one of the three files is selected randomly?
local add_schem = function(a, b, c, d, e, f, g, h, i)
minetest.register_decoration({
deco_type = "schematic",
place_on = a,
sidelen = 80,
fill_ratio = b,
biomes = c,
y_min = d,
y_max = e,
schematic = f,
flags = "place_center_x, place_center_z",
spawn_by = h,
num_spawn_by = i,
})
end
local path = minetest.get_modpath("modname") .. "/schematics/"
-- Basic Tree
add_schem({"a"}, 0.02, {"b"}, 3, 80, path .. "tree_1.mts", nil, nil, nil)
add_schem({"a"}, 0.02, {"b"}, 3, 120, path .. "tree_2.mts", nil, nil, nil)KCoombes wrote:Try this:
Adapted from Ethereal NG - WTFPL
twoelk wrote:Sokomine started a trees_lib
Vanessa's plants/biome library plants the stuff for More-Trees and others.
paramat wrote:Saving schematics with Worldedit has problems, you cannot set per-node probability for "air" or per-node force-place.
For full control and often faster working create schematic files using tables in this way https://github.com/minetest-mods/saveschems
Wuzzy wrote:Using schematics for tress has the huge drawback that they always look the same.
Sokomine wrote:Not exactly true, although most schematics are used that way and most of us don't care about the random factors that can be applied. Hmmm was a bit upset when learning that his schematics where used for storing houses and the like instead of the decorations he intended the file format and decorations mechanism to be used for :-)
Wuzzy wrote:Also, I heard that schematics were originally intended for small decorations and not full trees and entire buildings and such.
Wuzzy wrote:You may want to look into L-system trees, look here:
http://dev.minetest.net/Introduction_to_L-system_trees
L-system trees have the benefit that they can be more random. L-systems are really powerful tools IMO.
I even wrote a mod for helping people creating new L-system trees (to save your time and sanity):
viewtopic.php?f=11&t=9458
burli wrote:They both use L-Trees, which is buggy as far as I know. moretrees causes ugly shadows. Don't know how it is with trees_lib
Wuzzy wrote:Using schematics for tress has the huge drawback that they always look the same. Also, I heard that schematics were originally intended for small decorations and not full trees and entire buildings and such.
burli wrote:Can you post a link to schematics doc plz? Didn't found one yet
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)Users browsing this forum: No registered users and 3 guests