Froggy wrote:The lines from mapgen.lua seem to be it, although I'm hesitant to modify it, since I don't know anything about this. I'm going to need a bit of guidance with that. Also, I wouldn't want to have trees grow on sand. I'd like to make it so that dirt would be valuable and scarce. So that you'd need that dirt to grow trees and food to survive. In any case, I don't have enough programming experience to make mods (yet).
Cactus amount:What I do in Lua to try out stuff is 'commenting' them out. It's already used here in line 438. With
-- in front of a line, it isn't read as code.
line 438 -- Determine cactus amount from perlin noise
line 439 local cactus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 6 - 3)
To try out amount of cacti, I would copy line 439 and paste it under it, comment the original out and change something in the 'copy' like this:
line 438 -- Determine cactus amount from perlin noise
line 439
-- local cactus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 6 - 3)
line 440 local cactus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) *
12 - 3)
or
line 438 -- Determine cactus amount from perlin noise
line 439
-- local cactus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 6 - 3)
line 440 local cactus_amount =
2Since I can't predict (lack of knowledge) what exactly would happen and will screw up a few times, I can always delete line 440 and uncomment line 439 to get back the original code (and try again).
Growing of trees:As far as I understood, trees are 'made' in C++. They're also made out of more than 1 block.
So I guess that in case you would like to have control over them (and over dirt (with grass)), you should create a mod that generate a few blocks of dirt, combined with an ABM that makes tree grow on some of those block. You would need to add not only 1 block but a whole tree. I think a good example of making trees that way (the old way) is Cisouns Conifers mod:
https://forum.minetest.net/viewtopic.php?id=1453.Maybe the L-system now would be a better tool to create trees. I don't have experience with the L-system. jin-xi made a description
https://forum.minetest.net/viewtopic.php?id=4766 and a tool for it:
https://forum.minetest.net/viewtopic.php?id=4976but
reading this thread, maybe when you create a desert world with mgv6_freq_desert, that leaves some space for other (grasslands) biomes, you 'automatically' get scarce patches of dirt (with grass) and some trees on it.
I also found this in the minetest.conf.example:
#mgv6_np_trees = 0, 1, (125, 125, 125), 2, 4, 0.66
#mgv6_np_apple_trees = 0, 1, (100, 100, 100), 342902, 3, 0.45
Changing the values and using the lines in minetest.conf may give you some more control for the amount of trees.
I myself have no experience with the mgv6 settings so far.
I hope this doesn't confuse too much and helps you a little bit further. Actually I hope someone will know and tell you about better ways to reach your goal :-)
Edit: you might like this desert mod from Menche (link to the topic):
https://forum.minetest.net/viewtopic.php?id=3761and 2 from kddekadenz:
https://forum.minetest.net/viewtopic.php?id=1184https://forum.minetest.net/viewtopic.php?id=1656