Page 1 of 1

Access to getGroundLevelAtPoint() from Lua?

PostPosted: Sun Aug 23, 2015 17:42
by y.st.
Is there a way to access the getGroundLevelAtPoint() function used in C++ from Lua? I don't think there is, so I'm going to try to port it from C++ (mapgen_singlenode.cpp, mapgen_v5.cpp, mapgen_v6.cpp, and mapgen_v7.cpp) to Lua, but I want to make sure before I do so. I'd rather not waste time trying to port it if access to it is already available.

Re: Access to getGroundLevelAtPoint() from Lua?

PostPosted: Sun Aug 23, 2015 19:22
by BobbyBonsaimind
Why port it? See if you can expose it through the API.

Re: Access to getGroundLevelAtPoint() from Lua?

PostPosted: Sun Aug 23, 2015 20:41
by y.st.
BobbyBonsaimind wrote:Why port it? See if you can expose it through the API.

Huh. That is a very good point. I hadn't thought of doing that because:
* I don't understand the engine well and
* I'd have to wait for the next release for it to work after doing that

In the long run though, that would be a much better option. With it exposed to the API, any changes in the engine's function would automatically update how the Lua function works as well. It'll take some time, but I'll try to expose getGroundLevelAtPoint() to the Lua API. Thank you for the advice!