Page 1 of 1

Add a few things in the LUA API

PostPosted: Fri Jul 06, 2012 08:37
by Keriz
Hello everybody, I was thinking about a small thing to integrate in the LUA API.

What do you think of: (example)

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
minetest.register_on_collisionode(on_collision_fridge) --like register_on_punchnode


And the function will be:

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
local register_on_collisionode = function(pos, node, collider) --position of node, node and the collider
--collision to a specific bloc
if node.name ~= "default:tree" then return end
--And here we could get "how" the collider collide the node. exemple:
howCollide = collider:getCollision() --0 = enter on the block 1 = jumping

--And we could also get the collidername
isPlayer = collider.name

end


I don't know if my code is good, but I think that you see what I want to explain.

Sorry for my bad english and I hope that I posted in the good section.

PostPosted: Fri Jul 06, 2012 17:08
by Keriz
What do you think ? It will be very useful !

PostPosted: Fri Jul 06, 2012 17:09
by sfan5
It would be useful

PostPosted: Fri Jul 06, 2012 21:25
by Keriz
How to tell celeron about that ?

PostPosted: Sat Jul 07, 2012 02:35
by Melkor

PostPosted: Sat Jul 07, 2012 11:30
by Keriz
Wo, i'll have a look, but it is more convenient.