since it turned out not to be a bug, but the answers may be helpfull to moders, could this be moved to "Modding general" please?
Sorry for the inrtusion,
As I am not a c++ coder Im not sure this is the right place to put this but because I found something odd that I suspect may be a bug I will anyway. Please be free to refer me to the appropriate place.
I was researching how to find the ground level for use in voxelmanip for the placement of some things. In the below thread it appears dgm555 was having a simmilar problem.
viewtopic.php?f=9&t=9286&hilit=groundlevel
So I had a peek in the C++ code to see if it would be possible to redo the calculation of the groundlevel from the parameters and the perlin noise functions. I can't code C++ but I can read some of it.
The first thing I found was in mapgen.cpp
on line 922 it describes a function findGroundLevelFull, and then on 940 there is findGroundLevel. These simply check for the highest walkable node. I think it would be possible to do the same within my lua script. But my first question is are these exposed to the Lua API?
The problem with this approach is it is hard to tell if I landed on a tree or in a cave, so I kept on digging to try and find the ground height definition.
The second thing is in mapgen_v6.cpp
in the function baseTerrainLevelFromMap
on line 239 it says:
Your 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
int index = (p.Y - node_min.Z) * ystride + (p.X - node_min.X);
where I would expect:
Your 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
int index = (p.Z - node_min.Z) * ystride + (p.X - node_min.X);
I could well be wrong but please check.
While looking through mapgen_v6 I allso noticed the functions :
getGroundLevelAtPoint, block_is_underground, find_ground_level_from_noise and getBiome.
Simmilar to my first question are these available in the Lua API? These would allso be usefull for lua mapgen purposes.
Or would it be possible (without a lot of work) to make them available?
Kind regards,
Smitje