[SOLVED] moremesecons : Is it possible to query the position of a luablock in it's code

Post Reply
MT_Dad
New member
Posts: 8
Joined: Sun Oct 25, 2020 14:10

[SOLVED] moremesecons : Is it possible to query the position of a luablock in it's code

by MT_Dad » Post

See solution here (I hope I got the URL right):

viewtopic.php?p=383160#p383160


Greetings!

I am new to MT and discovering the possibilities of LUA.

I would like to use a luablock to trigger an action relavite to the position of the luablock, so it would be quite useful to query it's position in the code. Something like

pseudocode:
local pos = self:get_position
minetest.set_node({x=pos.x, y=pos.y+2, z=pos.z}, {name="default:ice"})


This way, it would not be necessary to look up the current position of the block and adapting the code when copying/moving the luablock.
Last edited by MT_Dad on Sun Nov 01, 2020 17:06, edited 1 time in total.

User avatar
joe7575
Member
Posts: 552
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: moremesecons : Is it possible to query the position of a luablock in it's code

by joe7575 » Post

You should ask this in the moremesecons thread so that the mod owner will see it.
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest