Access to getGroundLevelAtPoint() from Lua?

User avatar
y.st.
Member
 
Posts: 38
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: Yst
In-game: Yst

Access to getGroundLevelAtPoint() from Lua?

by y.st. » Sun Aug 23, 2015 17:42

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.
 

BobbyBonsaimind
Member
 
Posts: 97
Joined: Tue Apr 14, 2015 19:32
GitHub: RobertZenz
IRC: Robert_Zenz
In-game: Bobby

Re: Access to getGroundLevelAtPoint() from Lua?

by BobbyBonsaimind » Sun Aug 23, 2015 19:22

Why port it? See if you can expose it through the API.
 

User avatar
y.st.
Member
 
Posts: 38
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: Yst
In-game: Yst

Re: Access to getGroundLevelAtPoint() from Lua?

by y.st. » Sun Aug 23, 2015 20:41

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!
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 3 guests

cron