I tried to reproduce the code that Pilzadam used for his nether mod, but there are some differences in our methods. (I need to place some schematics while Pilzadam builds his portal directly using lua code).
Anyways he uses two functions:
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.get_voxel_manip():read_from_map(pos, pos)
minetest.emerge_area(vector.subtract(pos, 80), vector.add(pos, 80))
I can't understand the differences between these two function (I read the wiki for them). The first doesn't work for me and it gives me this error:
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/mods/nssb/mapgen.lua:792: attempt to index a nil value
I can't understand which is the nil value because the variable "pos" does exist and it is set.
The second function seems to work because it doesn't give any error and after it I can add the schematic, but when I teleport to the place where I have added the schematic the world isn't loaded and when finally it gets loaded the schematic is there but some of its block have not been correctly placed.
Can someone help me?
Thank You