Page 1 of 1

i need help with modding

PostPosted: Wed Oct 16, 2013 17:40
by durtective6
im trying to make new trees for my mod but dont know where to start could someone help me please? im just looking to make trees like the apple trees but with different fruit and maybe different wood types.

PostPosted: Wed Oct 16, 2013 18:26
by Topywo
You need to find out if you want to generate new trees or modify existing.

You could take a look at other mods: moretrees, tiny trees, the trees from farming plus and more (at least there must also be somewhere a mod making fruittrees (I can't find the link)).

When using existing trees ABM-ing some leaves into fruit would be sufficient.

PostPosted: Wed Oct 16, 2013 20:52
by durtective6
Thanks for the help, i think i would just like to generate new trees

PostPosted: Wed Oct 16, 2013 21:31
by Topywo
durtective6 wrote:Thanks for the help, i think i would just like to generate new trees


You could try to use the moretrees code with the L-system. There's info about it in minetest/doc/lua_api.txt
and here https://forum.minetest.net/viewtopic.php?id=4766

or

Use the code from farming plus (under init.lua and cocoa.lua/bananas.lua)

or

An old one I sometimes used, conifers:
https://forum.minetest.net/viewtopic.php?id=1453



Good luck!

PostPosted: Thu Oct 17, 2013 10:04
by durtective6
k thanks for the help

PostPosted: Sat Oct 19, 2013 20:47
by leetelate
gak! - if you make the example treedef in the lua.doc.txt you get this monster - i just wanted a pear tree like the default apple trees!!!

Image
pear_tree={
axiom="FFFFFAFFBF",
rules_a="[&&&FFFFF&&FFFF][&&&++++FFFFF&&FFFF][&&&----FFFFF&&FFFF]",
rules_b="[&&&++FFFFF&&FFFF][&&&--FFFFF&&FFFF][&&&------FFFFF&&FFFF]",
trunk="mylovelytree:peartrunk",
leaves="mylovelytree:pearleaves",
angle=30,
iterations=2,
random_level=0,
trunk_type="single",
thin_branches=true,
fruit_chance=10,
fruit="mylovelytree:pearfruit"
}
OUCH!!!

anybody have axiom/treedef for the regular default-size tree?

PostPosted: Sat Oct 19, 2013 21:12
by PilzAdam
leetelate wrote:anybody have axiom/treedef for the regular default-size tree?

The default tree is hardcoded, not created by axioms for the l-system. Look at src/treegen.cpp
I suggest you to use schematics, though.

PostPosted: Sat Oct 19, 2013 21:18
by leetelate
PilzAdam wrote:
leetelate wrote:anybody have axiom/treedef for the regular default-size tree?

The default tree is hardcoded, not created by axioms for the l-system. Look at src/treegen.cpp
I suggest you to use schematics, though.


thanks - i'll take a crack at coding a L-treegen for it just for the sheer pleasure or working it out!

PostPosted: Sun Oct 20, 2013 04:17
by leetelate
done and dusted

Image

pear_tree={
axiom="TTTATBfA",
rules_a = "[&&G^G-f-ff-fc-fff-fdf-fcff-ffcf-fffdf]",
rules_b = "[&&G^G-f-fc-ff-fdf-fff-ffdf-fdff-cfdff]",
rules_c = "G",
rules_d = "R",
trunk="mylovelytree:peartrunk",
leaves="mylovelytree:pearleaves",
angle=90,
fruit="mylovelytree:pearfruit"
}

even used the random c & d, but not the trunks and branches and random iterations since there is no room for that in the small tree

the cpp ones are way faster, even generating the random cpp way in lua is faster - L-system makes nice trees but sadly i'll prolly never use them

it was fun to make the treegen though - working out the upside-down turning turtle dragging the tail to draw the nodes

PostPosted: Sun Oct 27, 2013 12:09
by durtective6
how would i go about coding fruit and saplings?