HTOTM: FUSION
There are some undocumented function which iirc deal with environment object.

Thank you so much Psycore! I've just tried get_obj_pos and it actually works. This will give you the position of env_obj 1:

local x,y,z = get_obj_pos (0)
echo ("x: " .. x .. ", y: " .. y .. ", z: " .. z)
I should be able to do this on my own now, no more help needed.

Btw: where did you find those functions?

EDIT: Sorry, I was jumping to conclusions. The get_obj_rot function doesn't work:

local a = get_obj_rot (0)
echo("a: " .. a)
Looking at the get_body_info function, I assumed it could be this:

local a = get_obj_rot (0)
echo("a.r0: " .. a.r0 .. ", a.r1: " .. a.r1 .. ", a.r2: " .. a.r2) -- and so on with r3 etc..
But that doesn't work either. Well, the get_obj_pos function is already very helpful ...
Last edited by F3hler; Dec 1, 2015 at 10:28 PM.
Originally Posted by F3hler View Post
Btw: where did you find those functions?

There is a table called _G which contains all global variable including all functions. To print all function names to the console run this:

for k,v in pairs(_G) do
	if type(v) == "function" then
		echo(k)
	end
end
Keep in mind that some of those don't do anything because they are deprecated.

Originally Posted by F3hler View Post
EDIT: Sorry, I was jumping to conclusions. The get_obj_rot function doesn't work:

local a = get_obj_rot (0)
echo("a: " .. a)
Looking at the get_body_info function, I assumed it could be this:

local a = get_obj_rot (0)
echo("a.r0: " .. a.r0 .. ", a.r1: " .. a.r1 .. ", a.r2: " .. a.r2) -- and so on with r3 etc..
But that doesn't work either. Well, the get_obj_pos function is already very helpful ...

get_obj_rot returns 4x4 rotation matrix. The elements are stored in a[1] ... a[16], not a.r0 ... a.r15.
Signature temporarily out of order.
get_obj_rot returns 4x4 rotation matrix. The elements are stored in a[1] ... a[16], not a.r0 ... a.r15.

Ah, of course -.-

Thanks again, now I got what I wanted