I'm new to Minetest modding and Lua - but have been reading up
on the methods.
Possible bug report here. Minetest 0.4.16. More likely I just don't know what
I'm doing. I occaisionally use other mods - but this issue comes up when no
other mods are present.
After using programs and scripts to alter other (non Minetest) things over the
years - I thought I would try it in Minetest.
Goal:
HAC - houses as code
DAC - dungeons as code, etc.
Goal is to create any number of things via scripting. Somewhat like
raspberryjammod (very cool arpuss!) only without the Raspberry Pi and I'm also
trying to do it as a Lua mod as the developers intended.
Issue I'm running into (I think) is trying to operate on chunks not yet generated.
Not sure I'm Doing It Right.
Sample issue / steps to reproduce problem (on Linux):
* create sample mod 'q': mkdir ~/.minetest/mods/q
* setup init.lua with a simple script to make a pit
Code: Select all
minetest.register_chatcommand("pit100", {
-- create a pit 100 meters deep
-- by using a script!
func = function(name)
local player = minetest.get_player_by_name(name)
pos = player:get_pos()
for my_y=1, 100, 1
do
for my_z=1, 10, 1
do
for my_x=1, 10, 1
do
-- minetest.dig_node({x=pos.x - my_x - 2 , y=pos.y - my_y, z=pos.z - my_z})
minetest.remove_node({x=pos.x - my_x - 2 , y=pos.y - my_y, z=pos.z - my_z})
end
end
end
end,
})
* Seems to make a pit 7 meters deep - THEN A FLOOR - then the rest
of the pit underneath the floor (which I can see after a bit of
manual digging)
* Floor should not be there - just a pit 10 x 10 meters across and
100 meters deep. See attached screen shot.
* Is this a bug? Am I doing it wrong? Should I just shut up and dig
with a pick like everyone else?
Thanks for any input anyone has. Bonus points for answering in Lua, Python... (just kidding).
- desertmouse