firefox wrote:i know that sokomine's trees_lib can register new tree types, but it can only use existing tree models, not make new ones. also it does not support tree spawning at mapgen time, so the custom trees added by it can only be spawned as saplings.
The tree model has to come from somewhere, yes. trees_lib supports several ways of telling the game how your tree is supposed to look like.
firefox wrote:- how are the default tree models made?
i can't read the files in any way.
If you're saying "files", then you're most likely refering to trees defined in schematics. Those files usually have the extension .mts (MineTest schematic). Those files are not intended for beeing read by human beeings. They're a way to save a tiny part of a MineTest map, i.e. a house (or, in this case, a tree) and place it elsewhere (i.e. when the sapling grows). The schematics can also be used to spawn those "decorations" they contain (i.e. trees) at mapgen time. Ethereal makes heavy use of that. Some trees from the default minetest game also come as schematics. You can find them at
https://github.com/minetest/minetest_game/tree/master/mods/default/schematics.
firefox wrote:- how can i make new tree models?
If you want to take the schematic approch, you just fire up your Minetest world and start "building" the sample tree somewhere in the game - just like when you're building anything else. Once you're satisfied with your tree, you can save it as a schematic. For that, either use the
/mtschemcreate command from WorldEdit, or place two build chests from my handle_schematics mod.
firefox wrote:i heard about lua tables, but i don't understand at all how they are written and how to add random elements to the tree growth, like higher or lower trunks, more or less leaves and/or fruits.
The schematics are not overly flexible in that regard. They do allow for some randomness, but most of it is just placing the model. Although that may sound boring, it does create intresting landscapes. After all the trees intersect and are placed at diffrent heights. That's usually already quite sufficient for a good look.
firefox wrote:what i want to do is to add new trees with new models.
trees_lib can do this, but it can only use existing models and exchange the trunk and leaf nodes with customs ones.
trees_lib can do that as well :-) It was built for such a job. You just have to supply the art - the textures and the model :-)
firefox wrote:i have seen that other tree mods use lua tables to define trees, but there is now explanation how it works.
this is the banana tree from ethereal:
Ah :-) That is just another way of defining schematics. The best way to learn more about them (and how to spawn them at mapgen time) might be a look at
doc/lua_api.txt. Read all about schematics and decorations (in particular the section "Schematic specifier"), as that's what you are looking for.
Wuzzy wrote:A schematic is just a predefined set of blocks you can place, it will look exactly the same each time you place it, but you can also define every single block. Of course, it takes some time to create a good schematic.
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 :-)
I didn't have much time the last months and didn't pay sufficient attention to development. Has a good editor for schematics come up in the meantime? Static schematics are easy enough to handle - just build, save and use them - but those factors of randomness (y-slice probability and probability of single nodes) are not exactly intuitive. Using the lua table format is a way to handle that, but it's a lot easier to actually build the decoration in the game instead of creating the table manually.